index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777
  1. <template>
  2. <view>
  3. <wike-skeleton :count="5" v-if="homeTemplate.length === 0"></wike-skeleton>
  4. <view class="form u-flex align-center justify-center" :style="{height: windowHeight+'px'}"
  5. v-if="appInfo.page_template == 1 || !appInfo.page_template">
  6. <view class="top-notice" v-if="appInfo && appInfo.notice"><u-notice-bar
  7. :text="appInfo.notice"></u-notice-bar></view>
  8. <view class="logo"><u--image :src="appInfo.site_logo_path?appInfo.site_logo_path:'/static/images/head.jpg'"
  9. shape="circle" width="200rpx" height="200rpx"></u--image></view>
  10. <u-transition :show="true" mode="slide-left">
  11. <view class="title">{{ appInfo.site_name?appInfo.site_name:'A问答机器人' }}</view>
  12. </u-transition>
  13. <u-transition :show="true" mode="slide-right">
  14. <view class="desc">{{ appInfo.sub_title }}</view>
  15. </u-transition>
  16. <view class="btn-group">
  17. <view class="btn" @click="onToForm"><u-button shape="circle" iconColor="#ffffff" color="#26B3A0"
  18. icon="chat" text="立即提问"></u-button></view>
  19. <view v-if="appInfo.is_aipainting&&appInfo.is_aipainting == 1" class="btn" @click="ondraw"><u-button
  20. shape="circle" iconColor="#ffffff" color="#ffc107" icon="edit-pen-fill" text="AI绘画"></u-button>
  21. </view>
  22. <!-- #ifdef MP-WEIXIN -->
  23. <view class="btn">
  24. <u-button shape="circle" open-type="share" color="#26B3A0" :plain="true" icon="share"
  25. text="分享好友"></u-button>
  26. <!-- #ifdef H5 -->
  27. <!-- <u-button shape="circle" @click="h5share = true" color="#26B3A0" :plain="true" icon="share"
  28. text="分享好友"></u-button> -->
  29. <!-- #endif -->
  30. </view>
  31. <!-- #endif -->
  32. </view>
  33. </view>
  34. <view v-if="appInfo.page_template == 2 || appInfo.page_template == 3">
  35. <u-notice-bar v-if="appInfo && appInfo.notice" :text="appInfo.notice"></u-notice-bar>
  36. <view class="directask">
  37. <!-- 📝 -->
  38. <view class="askaquestion u-flex align-center justify-between">
  39. <!-- 🔥 -->
  40. <view class="u-flex align-center">
  41. <!-- <image src="/static/images/heat.png"></image> -->
  42. 📝直接提问
  43. </view>
  44. <block v-if="showchat4">
  45. <u-tag v-if="appInfo.page_template == 2" @click="showsheet = true"
  46. :text="currentmodel+(userData.vip_info&&userData.is_validity>0?(userData.vip_info.gpt4_type == 'time'?' - 今日':' - 会员')+'剩余提问:'+(userData.vip_info.gpt4_times == -1?'无限量':userData.vip_info.gpt4_times-userData.vip_info.gpt4_used+'次'):'')+' ▼'"
  47. plain shape="circle" plainFill color="#26b3a0" borderColor="#26b3a0"
  48. bgColor="#26b3a014"></u-tag>
  49. </block>
  50. <block v-else>
  51. <u-tag v-if="appInfo.page_template == 2" @click="showsheet = true"
  52. :text="currentmodel+(userData.vip_info&&userData.is_validity>0?(userData.vip_info.gpt35_type == 'time'?' - 今日':' - 会员')+'剩余提问:'+(userData.vip_info.gpt35_times == -1?'无限量':userData.vip_info.gpt35_times-userData.vip_info.gpt35_used+'次'):'')+' ▼'"
  53. plain shape="circle" plainFill color="#26b3a0" borderColor="#26b3a0"
  54. bgColor="#26b3a014"></u-tag>
  55. </block>
  56. </view>
  57. <view class="textarea">
  58. <u--textarea @focus="focustextarea" maxlength="-1" v-model="valuechat" height="100" border="none"
  59. :placeholder="placeholder"></u--textarea>
  60. <view class="operate u-flex align-center">
  61. <view v-if="appInfo.page_template == 3" style="margin-right: 32rpx;">
  62. <u--image :showLoading="true" :src="homeTemplate.mode[selectornot].img_file.path" width="30"
  63. height="30" @click="switchmodel = true" shape="circle"></u--image>
  64. </view>
  65. <view @click="valuechat = ''" class="empty">清空</view>
  66. <view @click="onSubmit(valuechat)" hover-class="hoversubmit" class="submit">{{tapsubmit}}</view>
  67. </view>
  68. </view>
  69. <view v-if="appInfo.page_template == 3" style="margin-bottom: 16px">
  70. <u-alert :title="appInfo.notice" type="warning" effect="dark"></u-alert>
  71. </view>
  72. <block v-if="appInfo.page_template == 2">
  73. <view class="askaquestion u-flex align-center justify-between">
  74. <!-- 🔥 -->
  75. <view class="u-flex align-center">
  76. <!-- <image src="/static/images/heat.png"></image> -->
  77. 🔥热门提问
  78. </view>
  79. <view @click="updateTemplate" class="tn-flex align-center"
  80. style="justify-content: flex-end;margin-top: 15rpx;">
  81. <view style="color: #9e9e9e;margin-right: 10rpx;">换一换</view>
  82. <u-icon name="reload" color="#9e9e9e" size="18"></u-icon>
  83. </view>
  84. </view>
  85. <block v-for="(item, index) in homeTemplate.hot" :key="index">
  86. <view class="case" @click="onSubmit(item.text)">{{ item.text }}</view>
  87. </block>
  88. </block>
  89. <!-- #ifdef MP-WEIXIN -->
  90. <view class="wxad" v-if="appInfo.wxad_index && appInfo.wxad_index >= 1">
  91. <view style="width: 100%;">
  92. <wike-flow-main :flowtype="appInfo.wxad_index" :banner_id="appInfo.banner_id"
  93. :video_banner_id="appInfo.video_banner_id" :native_id="appInfo.native_id"></wike-flow-main>
  94. </view>
  95. </view>
  96. <!-- #endif -->
  97. <block v-if="appInfo.page_template == 2">
  98. <view class="askaquestion u-flex align-center justify-between">
  99. <!-- 🛠️ -->
  100. <view class="u-flex align-center">
  101. <!-- <image src="/static/images/formwork.png"></image> -->
  102. 🛠️提问模板
  103. </view>
  104. <view @click="onhelper" class="tn-flex align-center"
  105. style="justify-content: flex-end;margin-top: 15rpx;">
  106. <view style="color: #9e9e9e;margin-right: 6rpx;">更多</view>
  107. <u-icon name="arrow-right" color="#9e9e9e" size="18"></u-icon>
  108. </view>
  109. </view>
  110. <view style="margin-bottom: 10rpx;" class="u-flex flex-wrap justify-between align-center">
  111. <navigator class="helpme" :url="'/pages/template/detail?id=' + item.id"
  112. v-for="(item, index) in homeTemplate.template" :key="index">
  113. <view class="title">{{ item.title }}</view>
  114. <view class="sub_title">{{ item.sub_title }}</view>
  115. </navigator>
  116. </view>
  117. </block>
  118. <wike-ad></wike-ad>
  119. </view>
  120. </view>
  121. <u-action-sheet @select="selectClick" :round="10" :actions="sheetlist" :title="titlesheet" :show="showsheet"
  122. safeAreaInsetBottom @close="showsheet = false" cancelText="关闭"></u-action-sheet>
  123. <!-- #ifdef H5 -->
  124. <u-popup :show="h5share" mode="center" @close="h5share = false">
  125. <view class="cu-dialog">
  126. <image class="guide-img" src="http://shopro.7wpp.com/imgs/modal/share_guide.png" mode=""></image>
  127. </view>
  128. </u-popup>
  129. <!-- #endif -->
  130. <u-popup :show="switchmodel" @close="switchmodel = false" :round="15" closeable>
  131. <view class="select u-flex justify-center"><text>选择角色</text></view>
  132. <scroll-view scroll-y="true"
  133. :style="{ height: homeTemplate.mode&&homeTemplate.mode.length > 6 ? 700 + 'rpx' : 'auto' }">
  134. <block v-for="(item, index) in homeTemplate.mode" :key="index">
  135. <view class="u-flex justify-between model_view">
  136. <u-avatar
  137. :src="item.img_file != null&&item.img_file.path?item.img_file.path:'/static/images/open.png'"
  138. shape="square" mode="aspectFill" size="60"></u-avatar>
  139. <view class="modelname">
  140. <view class="name">{{ item.name }}</view>
  141. <view class="modeldetails">{{ item.intro }}</view>
  142. </view>
  143. <view @click="onselect(index)" class="modelselect"
  144. :style="{ background: selectornot == index ? '#9e9e9e' : '' }">
  145. {{ selectornot == index ? '已选择' : '选择' }}
  146. </view>
  147. </view>
  148. </block>
  149. <view style="height: 30rpx;"></view>
  150. </scroll-view>
  151. </u-popup>
  152. <wike-model v-if="signShow" :authorize="false" :title="signTitle" btnText="立即获取" @save="signSign"
  153. @close="signShow = false"></wike-model>
  154. <block v-if="is_aipainting">
  155. <wike-tabbar2 v-if="appInfo.page_template == 3" :onTabbar="onTabbar" :is_aipainting="is_aipainting"
  156. :isShowAnimate="isShowAnimate" :appInfos="appInfo.page_template"></wike-tabbar2>
  157. <wike-tabbar v-else :onTabbar="onTabbar" :is_aipainting="is_aipainting" :isShowAnimate="isShowAnimate"
  158. :appInfos="appInfo.page_template"></wike-tabbar>
  159. </block>
  160. <wike-modal-qrcode :qrcode="gzhqrcode" :showconcern="showconcern"
  161. @concernclose="concernclose"></wike-modal-qrcode>
  162. </view>
  163. </template>
  164. <script>
  165. import {
  166. mapMutations,
  167. mapActions,
  168. mapState,
  169. mapGetters
  170. } from 'vuex';
  171. let interstitialAd = null,
  172. timer,
  173. time2;
  174. export default {
  175. components: {},
  176. data() {
  177. return {
  178. signTitle: '',
  179. signShow: false,
  180. selectornot: 0,
  181. onTabbar: false,
  182. isShowAnimate: false,
  183. valuechat: '',
  184. platform: this.$platform.get(),
  185. h5share: false,
  186. windowHeight: 0,
  187. placeholder: '您可以向AI提出任何问题...',
  188. tapsubmit: ' 提交问题',
  189. //模型
  190. // paintingmode:false,
  191. showsheet: false,
  192. titlesheet: '切换模型',
  193. //是否为gpt4模型
  194. showchat4: false,
  195. //模型数据
  196. // #ifdef MP-WEIXIN
  197. sheetlist: [{
  198. index: 1,
  199. name: 'ChatGPT 3.5',
  200. subname: "高效沟通·简单提问",
  201. color: '#26b3a0d6',
  202. disabled: false
  203. }, ],
  204. // #endif
  205. // #ifdef H5
  206. sheetlist: [{
  207. index: 0,
  208. name: 'ChatGPT 4.0',
  209. subname: "超级高效沟通·简单提问",
  210. disabled: false
  211. },
  212. {
  213. index: 1,
  214. name: 'ChatGPT 3.5',
  215. subname: "高效沟通·简单提问",
  216. color: '#26b3a0d6',
  217. disabled: false
  218. },
  219. ],
  220. // #endif
  221. // 消耗
  222. plan: {},
  223. currentmodel: '',
  224. switchmodel: false,
  225. is_aipainting: '',
  226. showconcern: false,
  227. gzhqrcode: ''
  228. };
  229. },
  230. computed: {
  231. ...mapGetters(['appInfo', 'isLogin', 'userInfo', 'homeTemplate', 'userData'])
  232. },
  233. onLoad() {
  234. var that = this;
  235. uni.getSystemInfo({
  236. success: function(res) {}
  237. });
  238. setTimeout(() => {
  239. that.onTabbar = true;
  240. that.isShowAnimate = true;
  241. }, 500);
  242. },
  243. onReady() {
  244. let that = this;
  245. // #ifdef MP-WEIXIN
  246. clearTimeout(timer);
  247. // 在适合的场景显示插屏广告
  248. timer = setTimeout(function() {
  249. // 在页面onLoad回调事件中创建插屏广告实例
  250. if (wx.createInterstitialAd && that.appInfo.interstitial_status == 1) {
  251. interstitialAd = wx.createInterstitialAd({
  252. adUnitId: that.appInfo.interstitial_id
  253. });
  254. interstitialAd.onLoad(() => {});
  255. interstitialAd.onError(err => {});
  256. interstitialAd.onClose(() => {
  257. if (that.appInfo.interstitial_infinite_status && that.appInfo
  258. .interstitial_infinite_status == 1) {
  259. that.showInterstitial();
  260. } else {
  261. interstitialAd.show().catch(err => {
  262. console.error(err);
  263. });
  264. }
  265. });
  266. interstitialAd.show().catch(err => {
  267. console.error(err);
  268. });
  269. }
  270. }, 4000);
  271. // #endif
  272. },
  273. onShow() {
  274. if (this.isLogin) {
  275. this.getUserData();
  276. this.currentmodel = uni.getStorageSync("prestore") || "";
  277. }
  278. this.init()
  279. this.windowHeight = uni.$u.sys().windowHeight
  280. this.systemwechat()
  281. },
  282. onUnload() {
  283. clearInterval(time2);
  284. },
  285. methods: {
  286. ...mapActions(['appInit', 'logout', 'getUserInfo', 'getUserData']),
  287. init() {
  288. var that = this;
  289. return Promise.all([this.appInit()]).then(res => {
  290. that.is_aipainting = that.appInfo.is_aipainting
  291. uni.setNavigationBarTitle({
  292. title: that.appInfo.site_name
  293. });
  294. that.getPlan();
  295. });
  296. },
  297. systemwechat() {
  298. this.$http('conf.getGroupConf', {
  299. group: 'system.wechat'
  300. }).then(res => {
  301. if (res.code == 0) {
  302. this.gzhqrcode = res.data.qrcode_path
  303. const focuson = uni.getStorageSync('focuson');
  304. // console.log(focuson);
  305. if (!focuson) {
  306. if (this.gzhqrcode) {
  307. if (this.appInfo.is_show_index_qrcode == 1) {
  308. this.showconcern = true
  309. }
  310. if (this.isLogin && this.appInfo.is_show_logged_qrcode == 1) {
  311. this.showconcern = true
  312. }
  313. }
  314. }
  315. }
  316. })
  317. },
  318. concernclose() {
  319. this.showconcern = false
  320. },
  321. onselect(e) {
  322. this.showcontext = false
  323. this.switchmodel = this.selectornot == e ? true : false
  324. this.selectornot = e;
  325. },
  326. showInterstitial() {
  327. time2 = setInterval(
  328. function() {
  329. interstitialAd.show().catch(err => {
  330. console.error(err);
  331. });
  332. },
  333. this.appInfo.gap ? this.appInfo.gap * 1000 : 12000
  334. );
  335. },
  336. //选择模型
  337. selectClick(index) {
  338. for (var a = 0; a < this.sheetlist.length; a++) {
  339. this.sheetlist[a].color = '#000'
  340. }
  341. // #ifdef MP-WEIXIN
  342. this.sheetlist[index.index - 1].color = '#26b3a0d6'
  343. // #endif
  344. // #ifdef H5
  345. this.sheetlist[index.index].color = '#26b3a0d6'
  346. // #endif
  347. this.showchat4 = index.index == 0 ? true : false
  348. // this.showchat4 = false
  349. this.getcurrentmodel()
  350. },
  351. getPlan() {
  352. let that = this;
  353. this.$http('conf.getGroupConf', {
  354. group: 'system.plan'
  355. }).then(res => {
  356. if (res.code == 0) {
  357. this.plan = res.data
  358. let gpt = this.appInfo;
  359. // #ifdef H5
  360. if (gpt.is_gpt4 == 2) {
  361. this.sheetlist.shift()
  362. this.sheetlist[0].name = gpt.gpt35_alias ? gpt.gpt35_alias : 'ChatGPT 3.5'
  363. this.sheetlist[0].subname = gpt.gpt35_intro ? gpt.gpt35_intro : '高效沟通·简单提问'
  364. } else {
  365. this.sheetlist[0].name = gpt.gpt4_alias ? gpt.gpt4_alias : 'ChatGPT 4.0'
  366. this.sheetlist[0].subname = gpt.gpt4_intro ? gpt.gpt4_intro : '高效沟通·简单提问'
  367. this.sheetlist[1].name = gpt.gpt35_alias ? gpt.gpt35_alias : 'ChatGPT 3.5'
  368. this.sheetlist[1].subname = gpt.gpt35_intro ? gpt.gpt35_intro : '高效沟通·简单提问'
  369. }
  370. // #endif
  371. // #ifdef MP-WEIXIN
  372. this.sheetlist[0].name = gpt.gpt35_alias ? gpt.gpt35_alias : 'ChatGPT 3.5'
  373. this.sheetlist[0].subname = gpt.gpt35_intro ? gpt.gpt35_intro : '高效沟通·简单提问'
  374. // #endif
  375. this.getcurrentmodel()
  376. }
  377. })
  378. },
  379. getcurrentmodel() {
  380. let gpt = this.appInfo;
  381. if (this.showchat4) {
  382. this.currentmodel = gpt.gpt4_alias ? gpt.gpt4_alias : 'ChatGPT 4.0'
  383. } else {
  384. this.currentmodel = gpt.gpt35_alias ? gpt.gpt35_alias : 'ChatGPT 3.5'
  385. }
  386. uni.setStorageSync('prestore', this.currentmodel);
  387. },
  388. updateTemplate() {
  389. this.$store.dispatch('getTemplate');
  390. },
  391. onToForm() {
  392. uni.navigateTo({
  393. url: '/pages/chat/chat'
  394. });
  395. },
  396. onhelper() {
  397. uni.switchTab({
  398. url: '/pages/template/template'
  399. });
  400. },
  401. focustextarea() {
  402. if (!this.isLogin) {
  403. uni.navigateTo({
  404. url: '/pages/user/signin'
  405. });
  406. uni.setStorageSync('route', '/pages/index/index');
  407. return;
  408. }
  409. },
  410. ondraw() {
  411. // uni.navigateTo({
  412. // url: '/pages/chat/chat?draw=1'
  413. // });
  414. uni.switchTab({
  415. url: '/pages/painting/painting'
  416. })
  417. },
  418. signSign() {
  419. uni.navigateTo({
  420. url: '/pages/user/member/member'
  421. });
  422. this.signShow = false
  423. },
  424. onSubmit(e) {
  425. var that = this;
  426. if (!that.isLogin) {
  427. uni.navigateTo({
  428. url: '/pages/user/signin'
  429. });
  430. uni.setStorageSync('route', '/pages/index/index');
  431. return;
  432. }
  433. if (!e) {
  434. uni.showToast({
  435. title: '请输入关键词或问题',
  436. icon: 'none'
  437. });
  438. return;
  439. }
  440. if (that.appInfo.time_member && that.appInfo.time_member == 1) {
  441. if (that.showchat4) {
  442. if (that.userData.vip_info && that.userData.is_validity > 0 && that.userData.vip_info.gpt4_used ==
  443. that.userData.vip_info.gpt4_times && that.userData.coin < that.plan.lock_gpt4) {
  444. var alias = that.appInfo.number_alias ? that.appInfo.number_alias : '点数';
  445. // this.signTitle = "<p style='font-weight: 550;font-size: 16px;'>您的提问<span>" + alias +
  446. // "</span>不足或会员套餐内剩余次数不足,无法发起提问</p>"
  447. this.signTitle =
  448. "<p style='font-weight: 550;font-size: 16px;'>提问需要<span style='color: #26b3a0;padding: 0 4px;'>" +
  449. that.plan.lock_gpt4 + "</span><span>" + alias +
  450. "</span></p><p style='padding-top: 10px;'>您的提问<span>" + alias +"</span>不足或会员套餐内剩余次数不足,无法发起提问</p>"
  451. this.signShow = true
  452. return;
  453. }
  454. if (that.userData.is_validity == 0&&that.userData.coin < that.plan.lock_gpt4) {
  455. var alias = that.appInfo.number_alias ? that.appInfo.number_alias : '点数';
  456. this.signTitle =
  457. "<p style='font-weight: 550;font-size: 16px;'>提问需要<span style='color: #26b3a0;padding: 0 4px;'>" +
  458. that.plan.lock_gpt4 + "</span><span>" + alias +
  459. "</span></p><p style='padding-top: 10px;'>您的提问<span>" + alias +"</span>不足或会员套餐内剩余次数不足,无法发起提问</p>"
  460. this.signShow = true
  461. return;
  462. }
  463. } else {
  464. if (that.userData.is_validity > 0 && that.userData.vip_info.gpt35_used == that.userData.vip_info
  465. .gpt35_times && that.userData.coin <= 0) {
  466. var alias = that.appInfo.number_alias ? that.appInfo.number_alias : '点数';
  467. // this.signTitle = "<p style='font-weight: 550;font-size: 16px;'>您的提问<span>" + alias +
  468. // "</span>不足或会员套餐内剩余次数不足,无法发起提问</p>"
  469. this.signTitle =
  470. "<p style='font-weight: 550;font-size: 16px;'>提问需要<span style='color: #26b3a0;padding: 0 4px;'>" +
  471. 1 + "</span><span>" + alias +
  472. "</span></p><p style='padding-top: 10px;'>您的提问<span>" + alias +"</span>不足或会员套餐内剩余次数不足,无法发起提问</p>"
  473. this.signShow = true
  474. return;
  475. }
  476. if (that.userData.is_validity == 0&&that.userData.coin <= 0) {
  477. var alias = that.appInfo.number_alias ? that.appInfo.number_alias : '点数';
  478. this.signTitle =
  479. "<p style='font-weight: 550;font-size: 16px;'>提问需要<span style='color: #26b3a0;padding: 0 4px;'>" +
  480. 1 + "</span><span>" + alias +
  481. "</span></p><p style='padding-top: 10px;'>您的提问<span>" + alias +"</span>不足或会员套餐内剩余次数不足,无法发起提问</p>"
  482. this.signShow = true
  483. return;
  484. }
  485. }
  486. } else {
  487. if (that.showchat4 && that.userData.coin < that.plan.lock_gpt4) {
  488. var alias = that.appInfo.number_alias ? that.appInfo.number_alias : '点数';
  489. this.signTitle =
  490. "<p style='font-weight: 550;font-size: 16px;'>提问需要<span style='color: #26b3a0;padding: 0 4px;'>" +
  491. that.plan.lock_gpt4 + "</span><span>" + alias +
  492. "</span></p><p style='padding-top: 10px;'>您当前有<span style='color: #26b3a0;padding: 0 4px;'>" +
  493. that.userData.coin + "</span><span>" + alias + "</span>,无法发起提问,快去获取<span>" + alias +
  494. "</span>吧</p>"
  495. this.signShow = true
  496. return;
  497. }
  498. if (!that.showchat4 && that.userData.coin <= 0) {
  499. var alias = that.appInfo.number_alias ? that.appInfo.number_alias : '点数';
  500. this.signTitle =
  501. "<p style='font-weight: 550;font-size: 16px;'>提问需要<span style='color: #26b3a0;padding: 0 4px;'>" +
  502. 1 + "</span><span>" + alias +
  503. "</span></p><p style='padding-top: 10px;'>您当前有<span style='color: #26b3a0;padding: 0 4px;'>" +
  504. that.userData.coin + "</span><span>" + alias + "</span>,无法发起提问,快去获取<span>" + alias +
  505. "</span>吧</p>"
  506. this.signShow = true
  507. return;
  508. }
  509. }
  510. // if(that.showchat4){
  511. // if(that.userData.coin < that.plan.lock_gpt4){
  512. // var alias = that.appInfo.number_alias ? that.appInfo.number_alias : '点数';
  513. // this.signTitle = "<p style='font-weight: 550;font-size: 16px;'>提问需要<span style='color: #26b3a0;padding: 0 4px;'>"+that.plan.lock_gpt4+"</span><span>"+alias+"</span></p><p style='padding-top: 10px;'>您当前有<span style='color: #26b3a0;padding: 0 4px;'>"+that.userData.coin+"</span><span>"+alias+"</span>,此模型不支持会员套餐,无法发起提问,快去获取<span>"+alias+"</span>吧</p>"
  514. // this.signShow = true
  515. // return;
  516. // }
  517. // }
  518. // if (that.appInfo.time_member && that.appInfo.time_member == 1) {
  519. // if (that.userData.is_validity > 0 && that.userData.vip_info.gpt35_used == that.userData.vip_info.gpt35_times && that.userData.coin <= 0) {
  520. // var alias = that.appInfo.number_alias ? that.appInfo.number_alias : '点数';
  521. // this.signTitle = "<p style='font-weight: 550;font-size: 16px;'>您的提问<span>"+alias+"</span>/会员套餐内剩余次数不足</p>"
  522. // this.signShow = true
  523. // return;
  524. // }
  525. // if (that.userData.is_validity == 0) {
  526. // if (that.userData.coin <= 0) {
  527. // var alias = that.appInfo.number_alias ? that.appInfo.number_alias : '点数';
  528. // this.signTitle = "<p style='font-weight: 550;font-size: 16px;'>您的提问<span>" + alias +
  529. // "</span>/会员套餐已到期</p>"
  530. // this.signShow = true
  531. // return;
  532. // }
  533. // }
  534. // } else {
  535. // if (that.userData.coin <= 0) {
  536. // var alias = that.appInfo.number_alias ? that.appInfo.number_alias : '点数';
  537. // this.signTitle = "<p style='font-weight: 550;font-size: 16px;'>您的提问<span>" + alias +
  538. // "</span>不足</p>"
  539. // this.signShow = true
  540. // return;
  541. // }
  542. // }
  543. if (that.showchat4) {
  544. uni.navigateTo({
  545. url: '/pages/chat/chat?showchat4=' + e + '&chat4=1'
  546. });
  547. that.valuechat = ''
  548. return;
  549. }
  550. uni.navigateTo({
  551. url: '/pages/chat/chat?question=' + e + '&selectornot=' + that.selectornot
  552. });
  553. }
  554. }
  555. };
  556. </script>
  557. <style lang="scss">
  558. .top-notice {
  559. position: fixed;
  560. top: 0;
  561. left: 0;
  562. width: 100%;
  563. }
  564. .form {
  565. flex-direction: column;
  566. .title {
  567. font-size: 38rpx;
  568. font-weight: bolder;
  569. margin: 15rpx 35rpx 0;
  570. }
  571. .desc {
  572. font-size: 28rpx;
  573. color: #666;
  574. margin: 15rpx 35rpx;
  575. }
  576. .btn-group {
  577. width: 80%;
  578. margin-top: 10%;
  579. .btn {
  580. margin: 30rpx 0rpx;
  581. .u-button {
  582. height: 100rpx;
  583. }
  584. }
  585. }
  586. }
  587. .directask {
  588. padding: 30rpx 30rpx 200rpx;
  589. border-top: 1px solid #ededed;
  590. .askaquestion {
  591. font-size: 32rpx;
  592. margin-bottom: 25rpx;
  593. image {
  594. width: 32rpx;
  595. height: 32rpx;
  596. margin-right: 12rpx;
  597. }
  598. }
  599. .textarea {
  600. box-shadow: 0px 0px 10px 5px #9e9e9e36;
  601. margin-top: 30rpx;
  602. margin-bottom: 30rpx;
  603. border-radius: 20rpx;
  604. padding: 20rpx 30rpx 30rpx 12rpx;
  605. .u-textarea {
  606. border-radius: 20rpx;
  607. }
  608. .operate {
  609. justify-content: flex-end;
  610. .empty {
  611. margin-right: 30rpx;
  612. border: 1px solid #9e9e9e;
  613. color: #9e9e9e;
  614. padding: 12rpx 42rpx;
  615. border-radius: 10rpx;
  616. }
  617. .submit {
  618. padding: 12rpx 42rpx;
  619. border-radius: 10rpx;
  620. border: 1px solid #26b3a0;
  621. background: linear-gradient(to right, #00ca88, #00BCD4);
  622. color: #fff;
  623. }
  624. .hoversubmit {
  625. background: #f7f7f7;
  626. color: #acacb3;
  627. }
  628. }
  629. }
  630. .case {
  631. color: #26b3a0;
  632. background: #f5f8f7;
  633. width: 100%;
  634. height: 80rpx;
  635. line-height: 80rpx;
  636. font-size: 30rpx;
  637. padding-left: 30rpx;
  638. border-radius: 10rpx;
  639. margin: 25rpx 0;
  640. border-radius: 10rpx;
  641. overflow: hidden;
  642. display: -webkit-box !important;
  643. text-overflow: ellipsis;
  644. word-break: break-all;
  645. -webkit-line-clamp: 1;
  646. -webkit-box-orient: vertical !important;
  647. }
  648. .helpme {
  649. background: #f5f8f7;
  650. border-radius: 20rpx;
  651. padding: 30rpx;
  652. width: 48%;
  653. margin-bottom: 25rpx;
  654. // height: 92px;
  655. .title {
  656. font-size: 30rpx;
  657. font-weight: bold;
  658. margin-bottom: 18rpx;
  659. color: #000;
  660. overflow: hidden;
  661. text-overflow: ellipsis;
  662. white-space: nowrap
  663. }
  664. .sub_title {
  665. color: #8f9ca2;
  666. font-size: 24rpx;
  667. overflow: hidden;
  668. text-overflow: ellipsis;
  669. display: -webkit-box;
  670. -webkit-box-orient: vertical;
  671. -webkit-line-clamp: 2;
  672. }
  673. }
  674. }
  675. .wxad {
  676. border-radius: 20rpx;
  677. overflow: hidden;
  678. margin-bottom: 24rpx;
  679. }
  680. .cu-dialog {
  681. position: fixed;
  682. top: 60rpx;
  683. left: 100rpx;
  684. }
  685. .guide-img {
  686. width: 580rpx;
  687. height: 430rpx;
  688. }
  689. .select {
  690. font-weight: bold;
  691. font-size: 32rpx;
  692. margin: 30rpx;
  693. }
  694. .model_view {
  695. margin: 30rpx;
  696. .modelname {
  697. font-size: 32rpx;
  698. font-weight: bold;
  699. width: 56%;
  700. .name {
  701. overflow: hidden;
  702. white-space: nowrap;
  703. text-overflow: ellipsis;
  704. }
  705. .modeldetails {
  706. font-size: 26rpx;
  707. font-weight: 500;
  708. margin-top: 12rpx;
  709. color: #9e9e9e;
  710. overflow: hidden;
  711. text-overflow: ellipsis;
  712. display: -webkit-box;
  713. -webkit-line-clamp: 2;
  714. -webkit-box-orient: vertical;
  715. }
  716. }
  717. .modelselect {
  718. background: #03a9f4;
  719. border-radius: 14rpx;
  720. color: #fff;
  721. width: 58px;
  722. height: 30px;
  723. line-height: 30px;
  724. text-align: center;
  725. }
  726. }
  727. </style>