yaofang/pages/chat/chat.js

174 lines
6.9 KiB
JavaScript

(global["webpackJsonp"] = global["webpackJsonp"] || []).push([ [ "pages/chat/chat" ], {
"4e6c": function(e, n, t) {
"use strict";
t.d(n, "b", function() {
return o;
}), t.d(n, "c", function() {
return a;
}), t.d(n, "a", function() {
return i;
});
var i = {
adInterstitial: function() {
return Promise.all([ t.e("common/vendor"), t.e("node-modules/@dcloudio/uni-cli-shared/components/ad-interstitial") ]).then(t.bind(null, "faa3"));
},
adRewardedVideo: function() {
return Promise.all([ t.e("common/vendor"), t.e("node-modules/@dcloudio/uni-cli-shared/components/ad-rewarded-video") ]).then(t.bind(null, "52ee"));
},
uniEasyinput: function() {
return t.e("uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput").then(t.bind(null, "aad6"));
},
bootNav: function() {
return Promise.all([ t.e("common/vendor"), t.e("components/bootNav/bootNav") ]).then(t.bind(null, "dc0f"));
},
xpop: function() {
return t.e("components/xpop/xpop").then(t.bind(null, "8c3c"));
}
}, o = function() {
var e = this, n = e.$createElement;
e._self._c;
e._isMounted || (e.e0 = function(n) {
e.ask = "";
});
}, a = [];
},
6384: function(e, n, t) {
"use strict";
t.r(n);
var i = t("f837"), o = t.n(i);
for (var a in i) [ "default" ].indexOf(a) < 0 && function(e) {
t.d(n, e, function() {
return i[e];
});
}(a);
n["default"] = o.a;
},
"7fc2": function(e, n, t) {
"use strict";
var i = t("a6d5"), o = t.n(i);
o.a;
},
a69d: function(e, n, t) {
"use strict";
(function(e, n) {
var i = t("4ea4");
t("94a9");
i(t("66fd"));
var o = i(t("ad71"));
e.__webpack_require_UNI_MP_PLUGIN__ = t, n(o.default);
}).call(this, t("bc2e")["default"], t("543d")["createPage"]);
},
a6d5: function(e, n, t) {},
ad71: function(e, n, t) {
"use strict";
t.r(n);
var i = t("4e6c"), o = t("6384");
for (var a in o) [ "default" ].indexOf(a) < 0 && function(e) {
t.d(n, e, function() {
return o[e];
});
}(a);
t("7fc2");
var s = t("f0c5"), c = Object(s["a"])(o["default"], i["b"], i["c"], !1, null, null, null, !1, i["a"], void 0);
n["default"] = c.exports;
},
f837: function(e, n, t) {
"use strict";
(function(e) {
var i = t("4ea4");
Object.defineProperty(n, "__esModule", {
value: !0
}), n.default = void 0;
var o = i(t("5c77")), a = {
components: {
xpop: function() {
t.e("components/xpop/xpop").then(function() {
return resolve(t("8c3c"));
}.bind(null, t)).catch(t.oe);
}
},
data: function() {
return {
title: "智能问答",
isProduct: 0,
scrollHeight: "height:300px;",
ask: "",
itemList: [],
current_page: 0,
last_page: 1,
noMore: 0,
endId: "",
type: "center",
msgType: "success",
messageText: "这是一条成功提示",
value: "",
loading: !1
};
},
onReady: function() {
var n = this;
e.getSystemInfo({
success: function(e) {
var t = 150;
e.windowHeight > 800 && (t = 250), n.scrollHeight = "height:" + (e.windowHeight - t) + "px;";
}
}), this.getSessions(), this.cpAd(), this.initRewardAd();
},
methods: {
onShareAppMessage: function() {
return {
title: this.title
};
},
onShareTimeline: function() {
return {
title: this.title
};
},
subAsk: function() {
"" === this.ask ? e.showToast({
title: "请输入需要提问的内容",
icon: "error",
duration: 2e3
}) : o.default.toAsk(this);
},
getSessions: function() {
this.x_request("api/chat/lst", {
page: this.current_page + 1
}, function(e, n) {
1 === n.code && (e.itemList = e.itemList.concat(n.data.data), e.current_page = n.data.current_page,
e.last_page = n.data.last_page, e.toEnd());
});
},
toEnd: function() {
var e = this.itemList.length;
this.endId = "end" + (e - 1);
},
playVideo: function() {
var e = this;
console.log("play"), console.log(this.videoAd), this.videoAd && this.videoAd.show().catch(function() {
e.videoAd.load().then(function() {
return e.videoAd.show();
}).catch(function(e) {
console.log("激励视频 广告显示失败");
});
}), 1 === this.isAdUni && this.$refs.adRewardedVideo.show();
},
addTimes: function() {
this.x_request("api/chat/addTimes", {}, function(e, n) {
e.x_tips("success", "成功领取免费提问次数");
});
},
dialogConfirm: function() {
this.playVideo();
},
onadclose: function(e) {
var n = e.detail;
n && n.isEnded ? this.addTimes() : console.log("onClose " + n.isEnded);
}
}
};
n.default = a;
}).call(this, t("543d")["default"]);
}
}, [ [ "a69d", "common/runtime", "common/vendor" ] ] ]);