member.vue 27 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004
  1. <template>
  2. <view>
  3. <view style="color: #000;">
  4. <tn-nav-bar backgroundColor="#ffffff" :bottomShadow="false">我的{{appInfo.number_alias?appInfo.number_alias:'点数'}}{{appInfo.time_member==1?'/会员套餐':''}}
  5. </tn-nav-bar>
  6. </view>
  7. <view :style="{height: tobheight+'px'}"></view>
  8. <view class="flex-rb-cc" style="padding: 25px 15px 20px;justify-content: end;background: linear-gradient(to right, #00ca88, #00BCD4);">
  9. <!-- <image class="user-avatar" :src="userInfo.avatar" mode="aspectFill"></image> -->
  10. <u-avatar :src="userInfo.avatar" size="70" mode="aspectFill"></u-avatar>
  11. <view class="flex-fill ml20">
  12. <view class="u-flex align-center justify-between" style="margin-bottom: 16rpx">
  13. <view class="bold" style="font-size: 36rpx;color: #fff;">{{userInfo.nickname}}</view>
  14. <u-tag @click="getrecord" text="记录" type="warning"
  15. shape="circle"></u-tag>
  16. </view>
  17. <view class="flex-cc align-center ">
  18. <!-- <text style="font-size: 30rpx;font-weight: bold;color: #ffc107;">剩余次数:{{userData.coin?userData.coin:0}}次</text> -->
  19. <!-- {{(appInfo.number_alias?appInfo.number_alias+':':'点数:')}} -->
  20. <u-tag :text="userData.coin?(appInfo.number_alias?appInfo.number_alias+':':'点数:')+userData.coin:(appInfo.number_alias?appInfo.number_alias+':':'点数:')+0" plain type="warning"
  21. shape="circle" color="#ffeb3b" borderColor="#ffeb3b"></u-tag>
  22. <block v-if="appInfo.time_member && appInfo.time_member==1">
  23. <view style="width: 10rpx;"></view>
  24. <u-tag :text="userData.is_validity == 1?'会员套餐:'+ (userData.vip_time == 9999?'永久':userData.countdown+'天'):'会员套餐:0天'" plain
  25. type="warning" shape="circle" color="#ffeb3b" borderColor="#ffeb3b"></u-tag>
  26. <!-- <u-tag :text="userData.is_validity == 1?'会员套餐:'+ (userData.vip_time == 9999?'永久':userData.countdown+'天'):'会员套餐:0天'" plain
  27. type="warning" shape="circle" color="#ffeb3b" borderColor="#ffeb3b"></u-tag> -->
  28. </block>
  29. <!-- <image class="ico-vip mr10" :src="userInfo.coin>0?'/static/images/diamond_fill_vippage_icon@2x.png':'/static/images/diamond_vippage_icon@2x.png'"></image> -->
  30. <!-- <text class="tn-color-brown" style="opacity: 0.5;font-size: 28rpx;">1</text> -->
  31. </view>
  32. </view>
  33. </view>
  34. <u-tabs v-if="showtabs" :list="tabList" lineWidth="50" lineHeight="5" lineColor="#00ca88" :current="tabindex" :activeStyle="{
  35. color: '#303133',
  36. fontWeight: 'bold',
  37. fontSize: '32rpx',
  38. transform: 'scale(1.05)'
  39. }" :inactiveStyle="{
  40. color: '#606266',
  41. fontSize: '32rpx',
  42. transform: 'scale(1)'
  43. }" itemStyle="padding-left: 15px; padding-right: 15px; height: 38px;" @click="gettabs">
  44. </u-tabs>
  45. <blcok v-if="list.length&&tabindex < 2">
  46. <view class="form">
  47. <view class="form-choice " :class="current==index?'active':''"
  48. v-for="(item,index) in list" :key="index" @click="setItem(index)">
  49. <view class="flex-rb-cc">
  50. <view class="fz-32 bold flex-cc">
  51. <text style="font-size: 40rpx;max-width: 380rpx;">{{item.title}}</text>
  52. <!-- <text v-if="item.coin" style="font-size: 38rpx;">{{item.coin}} 次数</text> -->
  53. <!-- <image class="ico-special" style="margin-left: 40rpx;" :src="current==index?'/static/images/special_time_w@2x.png':'/static/images/special_time_w@2x.png'" v-if="item.is_preferential ==1"></image> -->
  54. </view>
  55. <view class="tr " >
  56. <view class="mt10 fz-24 fc-c5 line-through"
  57. v-if="item.original_price">¥{{item.original_price}}</view>
  58. <view class="bold">
  59. <text class="fz-32">¥ </text>
  60. <text class="fz-38 pricefont">{{item.price}}</text>
  61. </view>
  62. </view>
  63. </view>
  64. <!-- <view v-else class="mt10 fz-26" :class="current==index?'selected':'fc-c5'">会员天数
  65. {{item.day == 9999?'永久':item.day}}
  66. </view> -->
  67. <view class="form-special" v-if="item.is_preferential === 1">(限时特价)</view>
  68. <view v-if="type==1&&item.coin" class="mt10 fz-26"
  69. :class="current==index?'selected':'fc-c5'">{{appInfo.number_alias?appInfo.number_alias:'点数'}}
  70. {{item.coin}}
  71. </view>
  72. <view v-else class="u-flex flex-wrap" >
  73. <view v-if="item.gpt35_times == -1 || item.gpt35_times > 0" class="packagetag">
  74. <u-tag @click="setItem(index)" :text="appInfo.gpt35_alias ? appInfo.gpt35_alias+(item.gpt35_times == -1?' 无限量':' '+item.gpt35_times+'次')+(item.gpt35_type=='time'?'/天':'') : 'ChatGPT 3.5'+(item.gpt35_times == -1?' 无限量':' '+item.gpt35_times+'次')+(item.gpt35_type=='time'?'/天':'')" plain
  75. type="warning" size="mini" shape="circle" :color="current==index?'#ffeb3b':'#ccc'" :borderColor="current==index?'#ffeb3b':'#ccc'"></u-tag>
  76. </view>
  77. <view v-if="item.gpt4_times == -1 || item.gpt4_times > 0" class="packagetag">
  78. <u-tag @click="setItem(index)" :text="appInfo.gpt4_alias ? appInfo.gpt4_alias+(item.gpt4_times == -1?' 无限量':' '+item.gpt4_times+'次')+(item.gpt4_type=='time'?'/天':'') : 'ChatGPT 4.0'+(item.gpt4_times == -1?' 无限量':' '+item.gpt4_times+'次')+(item.gpt4_type=='time'?'/天':'')" plain
  79. type="warning" size="mini" shape="circle" :color="current==index?'#ffeb3b':'#ccc'" :borderColor="current==index?'#ffeb3b':'#ccc'"></u-tag>
  80. </view>
  81. <view v-if="item.sd_times == -1 || item.sd_times > 0" class="packagetag">
  82. <u-tag @click="setItem(index)" :text="'StableDiffusion绘图'+(item.sd_times == -1?' 无限量':' '+item.sd_times+'次')+(item.sd_type=='time'?'/天':'')" plain
  83. type="warning" size="mini" shape="circle" :color="current==index?'#ffeb3b':'#ccc'" :borderColor="current==index?'#ffeb3b':'#ccc'"></u-tag>
  84. </view>
  85. <view v-if="item.mj_times == -1 || item.mj_times > 0" class="packagetag">
  86. <u-tag @click="setItem(index)" :text="'MidJourney绘图'+(item.mj_times == -1?' 无限量':' '+item.mj_times+'次')+(item.mj_type=='time'?'/天':'')" plain
  87. type="warning" size="mini" shape="circle" :color="current==index?'#ffeb3b':'#ccc'" :borderColor="current==index?'#ffeb3b':'#ccc'"></u-tag>
  88. </view>
  89. </view>
  90. </view>
  91. </view>
  92. <block v-if="instructions">
  93. <view style="margin: 20rpx 30rpx;">
  94. <text style="font-size: 26rpx;color: #9e9e9e;" >{{instructions}}</text>
  95. </view>
  96. </block>
  97. <view v-if="appInfo.kf_qrcode_path&&platform == 'H5'" class="explain">
  98. <view class="kf_qrcode tn-flex justify-center">
  99. <u--image :showLoading="true" :src="appInfo.kf_qrcode_path" width="150px" height="150px" @click="clickuimage(appInfo.kf_qrcode_path)"></u--image>
  100. </view>
  101. <view class="u-text-center">
  102. <!-- #ifdef MP-WEIXIN -->
  103. 长按上方二维码,添加客服购买卡密
  104. <!-- #endif -->
  105. <!-- #ifdef H5 -->
  106. 保存上方二维码,添加客服购买卡密
  107. <!-- #endif -->
  108. </view>
  109. </view>
  110. <view style="padding-top: 136rpx;width: 1rpx;">
  111. <!-- <Xbottom></Xbottom> -->
  112. </view>
  113. <!-- &&platform != 'H5' -->
  114. <view class="bottom-page" v-if="list.length>0">
  115. <view class="flex-rb-cc">
  116. <view>
  117. <view class="bold mb10">
  118. <text class="fz-48 pricefont" style="line-height: 62rpx;">{{list[current].price}}</text>
  119. <text class="fz-24"> 元</text>
  120. </view>
  121. <view class="flex-cc">
  122. </view>
  123. </view>
  124. <!-- #ifdef MP-WEIXIN -->
  125. <view @click="buy" v-if="device != 'ios'" class="bottom-btn">购买</view>
  126. <view @click="buy" v-else-if="device == 'ios'&&show_ios_pay" class="bottom-btn">购买</view>
  127. <!-- <view class="bottom-btn" v-else>IOS暂不支持购买</view> -->
  128. <!-- #endif -->
  129. <!-- #ifdef H5 -->
  130. <view @click="buy" class="bottom-btn">购买</view>
  131. <!-- #endif -->
  132. </view>
  133. <!-- <Xbottom></Xbottom> -->
  134. </view>
  135. </blcok>
  136. <!-- <block v-else>
  137. <view v-if="appInfo.kf_qrcode_path" class="explain">
  138. <view class="kf_qrcode tn-flex justify-center">
  139. <u--image :showLoading="true" :src="appInfo.kf_qrcode_path" width="150px" height="150px" @click="clickuimage(appInfo.kf_qrcode_path)"></u--image>
  140. </view>
  141. <view class="u-text-center">
  142. <!-- #ifdef MP-WEIXIN -->
  143. <!-- 长按上方二维码,添加客服了解详情 -->
  144. <!-- #endif -->
  145. <!-- #ifdef H5 -->
  146. <!-- 保存上方二维码,添加客服了解详情 -->
  147. <!-- #endif -->
  148. <!-- </view>
  149. </view>
  150. </block> -->
  151. <block v-if="tabindex == everyday">
  152. <view v-if="plan.sign>0" class="task-item flxe align-center justify-between">
  153. <view class="task-title">
  154. <view class="task-content">
  155. 签到领{{appInfo.number_alias?appInfo.number_alias:'点数'}}(今日{{userData.sign_count_today}}/1)
  156. </view>
  157. <view class="task-frequency">{{plan.sign}}{{appInfo.number_alias?appInfo.number_alias:'点数'}}/次</view>
  158. </view>
  159. <view v-if="userData.sign_count_today == 1" class="task-buttons">立即签到</view>
  160. <view v-else class="task-button" @click="memberaddCoin('sign')">立即签到</view>
  161. </view>
  162. <!-- #ifdef MP-WEIXIN -->
  163. <view v-if="plan.video>0" class="task-item flxe align-center justify-between">
  164. <view class="task-title">
  165. <view class="task-content">
  166. 观看视频领{{appInfo.number_alias?appInfo.number_alias:'点数'}}(今日{{userData.video_count_today}}/{{plan.video_limit}})
  167. </view>
  168. <view class="task-frequency">{{plan.video}}{{appInfo.number_alias?appInfo.number_alias:'点数'}}/次</view>
  169. </view>
  170. <view v-if="userData.video_count_today == plan.video_limit" class="task-buttons">立即观看</view>
  171. <view v-else class="task-button" @click="showInterstitialAd">立即观看</view>
  172. </view>
  173. <view v-if="plan.share>0" class="task-item flxe align-center justify-between">
  174. <view class="task-title">
  175. <view class="task-content">
  176. 分享给好友领{{appInfo.number_alias?appInfo.number_alias:'点数'}}(今日{{userData.share_count_today}}/{{plan.share_limit}})
  177. </view>
  178. <view class="task-frequency">{{plan.share}}{{appInfo.number_alias?appInfo.number_alias:'点数'}}/次</view>
  179. </view>
  180. <block>
  181. <view v-if="userData.share_count_today == plan.share_limit" class="task-buttons">立即分享</view>
  182. <view v-else class="task-button">立即分享</view>
  183. </block>
  184. <button v-if="userData.share_count_today < plan.share_limit" class="share-button"
  185. open-type="share"></button>
  186. <!-- <button class="share-button"
  187. open-type="share"></button> -->
  188. </view>
  189. <!-- #endif -->
  190. <!-- <block v-if="$platform.get() === 'wxOfficialAccount'">
  191. <view class="task-item flxe align-center justify-between">
  192. <view class="task-title">
  193. <view class="task-content">
  194. 分享给好友领{{appInfo.number_alias?appInfo.number_alias:'点数'}}(今日{{ userData.share_count_today ? userData.share_count_today : 0 }}/{{ plan.share_limit ? plan.share_limit : 0 }})
  195. </view>
  196. <view class="task-frequency">{{ plan.share ? plan.share : 0 }}{{appInfo.number_alias?appInfo.number_alias:'点数'}}/次</view>
  197. </view>
  198. <block>
  199. <view v-if="userData.share_count_today == plan.share_limit" class="task-buttons">立即分享</view>
  200. <view v-else @click="tabh5share" class="task-button">立即分享</view>
  201. </block>
  202. </view>
  203. </block> -->
  204. <!-- device == 'ios'&&!show_ios_pay -->
  205. <view style="margin: 30rpx;">
  206. <wike-ad></wike-ad>
  207. </view>
  208. </block>
  209. <!-- <u-loading-page :loading="loading" loading-text="正在加载" icon-size="35" color="#9e9e9e" loadingColor="#9e9e9e">
  210. </u-loading-page> -->
  211. <!-- #ifdef H5 -->
  212. <u-popup :show="h5share" mode="center" @close="offh5share">
  213. <view class="cu-dialog"><image class="guide-img" src="http://shopro.7wpp.com/imgs/modal/share_guide.png" mode=""></image></view>
  214. </u-popup>
  215. <!-- #endif -->
  216. <wike-loading-page :isLoading="isLoading"></wike-loading-page>
  217. </view>
  218. </template>
  219. <script>
  220. import {
  221. mapMutations,
  222. mapActions,
  223. mapState,
  224. mapGetters
  225. } from 'vuex';
  226. import ShoproPay from '@/common/pay';
  227. import share from '@/common/share';
  228. import {
  229. API_STEROOT,
  230. } from '@/common/request/request';
  231. let rewardedVideoAd = null;
  232. let sharetime;
  233. export default {
  234. data() {
  235. return {
  236. tabindex: 0,
  237. current: 0,
  238. list: [],
  239. device: this.$platform.device(),
  240. loading: true,
  241. tabList: [
  242. {
  243. id: 1,
  244. name: '购买点数'
  245. },
  246. {
  247. id: 2,
  248. name: '购买会员套餐'
  249. },
  250. // {
  251. // id: 3,
  252. // name: '免费领次数',
  253. // badge: {
  254. // isDot: true
  255. // }
  256. // },
  257. ],
  258. tobheight: 45,
  259. platform: this.$platform.get(),
  260. plan: {},
  261. show_ios_pay: false,
  262. isLoading: true,
  263. type: 1,
  264. instructions:'',
  265. h5share: false,
  266. showshare:false,
  267. everyday:2,
  268. showtabs:true
  269. }
  270. },
  271. computed: {
  272. ...mapGetters(['appInfo', 'userInfo', 'userData','isLogin'])
  273. },
  274. watch: {
  275. appInfo: function(e) {
  276. if (this.isLogin) {
  277. this.getUserData();
  278. }
  279. }
  280. },
  281. onUnload() {
  282. share.setShareInfo();
  283. },
  284. onLoad(e) {
  285. // console.log(e);
  286. var that = this;
  287. if (this.platform == 'wxMiniProgram') {
  288. var menumtop = uni.getMenuButtonBoundingClientRect().top - uni.getSystemInfoSync().statusBarHeight
  289. var paddingtop = uni.getSystemInfoSync().statusBarHeight + menumtop
  290. this.tobheight = (menumtop + paddingtop + uni.getMenuButtonBoundingClientRect().height)
  291. }
  292. // if (e && e.id) {
  293. // this.tabindex = Number(e.id)
  294. // if (Number(e.id) < 3) {
  295. // this.type = Number(e.id)
  296. // this.memberlist();
  297. // }else{
  298. // this.isLoading = false
  299. // }
  300. // }else{
  301. // }
  302. this.getPlan()
  303. // #ifdef MP-WEIXIN
  304. if (wx.createRewardedVideoAd) {
  305. rewardedVideoAd = wx.createRewardedVideoAd({
  306. adUnitId: this.appInfo.video_id
  307. })
  308. rewardedVideoAd.onLoad(() => {
  309. // console.log('onLoad event emit')
  310. });
  311. rewardedVideoAd.onError(err => {
  312. // console.log('onError event emit', err)
  313. });
  314. rewardedVideoAd.onClose(res => {
  315. if (res && res.isEnded) {
  316. // 正常播放结束,可以下发游戏奖励
  317. uni.showToast({
  318. title: (this.appInfo.number_alias?this.appInfo.number_alias+' +':'点数 +') + this.plan.video
  319. })
  320. this.memberaddCoin('video')
  321. } else {
  322. // 播放中途退出,不下发游戏奖励
  323. uni.showToast({
  324. title: '看完视频后才可获得'+this.appInfo.number_alias?this.appInfo.number_alias+'奖励':'点数奖励',
  325. icon: 'none'
  326. });
  327. }
  328. });
  329. }
  330. // #endif
  331. // if (!this.appInfo.time_member || this.appInfo.time_member != 1) {
  332. // this.tabList.splice(1,1)
  333. // }
  334. // #ifdef H5
  335. share.setShareInfo({
  336. title: that.appInfo.site_name,
  337. image: that.appInfo.share_img_path,
  338. });
  339. // #endif
  340. },
  341. onShareAppMessage: function(res) {
  342. if (res.from === 'button') {
  343. this.memberaddCoin('share')
  344. }
  345. return {
  346. title: this.appInfo.site_name,
  347. imageUrl: this.appInfo.share_img_path
  348. }
  349. },
  350. onShow() {
  351. if (this.isLogin) {
  352. this.getUserData();
  353. }else{
  354. uni.navigateTo({
  355. url: '/pages/user/signin'
  356. });
  357. uni.setStorageSync('route', '/pages/member/member');
  358. return;
  359. }
  360. // this.getPlan()
  361. },
  362. methods: {
  363. ...mapActions(['getUserData']),
  364. memberlist(i) {
  365. // console.log(i);
  366. var that = this;
  367. this.$http('member.list', {
  368. type: i
  369. }).then(res => {
  370. if (res.code == 0) {
  371. uni.setNavigationBarTitle({
  372. title: this.appInfo.site_name
  373. });
  374. // #ifdef MP-WEIXIN
  375. if(this.device != 'ios'){
  376. this.list = res.data
  377. }else if(this.device == 'ios'&&this.show_ios_pay){
  378. this.list = res.data
  379. }else{
  380. this.list = []
  381. this.showtabs = false
  382. }
  383. // #endif
  384. // #ifdef H5
  385. this.list = res.data
  386. // #endif
  387. this.isLoading = false
  388. }else{
  389. uni.showToast({
  390. title:'暂无数据',
  391. icon:'none'
  392. })
  393. this.isLoading = false
  394. }
  395. });
  396. },
  397. tabh5share(){
  398. this.h5share = true
  399. sharetime = setTimeout(() => {
  400. this.showshare = true
  401. // console.log(this.showshare,1);
  402. }, 3000);
  403. },
  404. offh5share(){
  405. this.h5share = false
  406. // console.log(this.showshare,2);
  407. if(this.showshare){
  408. this.memberaddCoin('share');
  409. this.showshare = false
  410. }else{
  411. clearTimeout(sharetime)
  412. }
  413. },
  414. clickuimage(e){
  415. uni.previewImage({
  416. urls:[e]
  417. })
  418. },
  419. setItem(e) {
  420. // console.log(e);
  421. this.current = e
  422. },
  423. showInterstitialAd() {
  424. // rewardedVideoAd.show();
  425. if (rewardedVideoAd && this.appInfo.video_status == 1) {
  426. uni.showToast({
  427. title: '广告拉取中',
  428. icon: 'loading'
  429. })
  430. rewardedVideoAd.show().catch(() => {
  431. // 失败重试
  432. rewardedVideoAd.load()
  433. .then(() => rewardedVideoAd.show())
  434. .catch(err => {
  435. // console.log('激励视频 广告显示失败')
  436. uni.showToast({
  437. title: '广告显示失败',
  438. icon: 'none'
  439. })
  440. })
  441. })
  442. } else {
  443. uni.showToast({
  444. title: '广告显示错误',
  445. icon: 'none'
  446. })
  447. }
  448. },
  449. ytrty(){
  450. var that = this;
  451. if(that.$Route.query.id){
  452. for(var i=0;i<this.tabList.length;i++){
  453. // console.log(that.$Route.query.id);
  454. if(that.tabList[i].id == that.$Route.query.id){
  455. that.tabindex = i
  456. // console.log(that.$Route.query.id);
  457. if(that.$Route.query.id == 3){
  458. this.isLoading = false
  459. return;
  460. }
  461. this.memberlist(that.$Route.query.id);
  462. }
  463. }
  464. }else{
  465. this.memberlist(that.tabList[0].id);
  466. }
  467. },
  468. systemmember(){
  469. this.$http('conf.getGroupConf', {
  470. group: 'system.member'
  471. }).then(res => {
  472. if (res.code == 0) {
  473. this.instructions = res.data.instructions
  474. // console.log(this.instructions);
  475. }})
  476. },
  477. getPlan() {
  478. let that = this;
  479. this.$http('conf.getGroupConf', {
  480. group: 'system.plan'
  481. }).then(res => {
  482. if (res.code == 0) {
  483. for(var i=0;i<this.tabList.length;i++){
  484. if(that.tabList[i].id == 1){
  485. that.tabList[i].name = '购买'+(that.appInfo.number_alias?that.appInfo.number_alias:'点数')
  486. }
  487. }
  488. this.plan = res.data
  489. // console.log();
  490. // console.log(this.appInfo.time_member);
  491. if(this.appInfo.is_time_front&&this.appInfo.is_time_front == 1){
  492. this.tabList.reverse()
  493. }
  494. if(this.appInfo.time_member&&this.appInfo.time_member == 2){
  495. for(var i=0;i<this.tabList.length;i++){
  496. if(that.tabList[i].id == 2){
  497. this.tabList.splice(i,1)
  498. }
  499. }
  500. }
  501. if(this.appInfo.number_member&&this.appInfo.number_member == 2){
  502. for(var i=0;i<this.tabList.length;i++){
  503. if(that.tabList[i].id == 1){
  504. // console.log(i);
  505. this.tabList.splice(i,1)
  506. }
  507. }
  508. }
  509. let tntv = {
  510. id: 3,
  511. name: '免费领'+(that.appInfo.number_alias?that.appInfo.number_alias:'点数'),
  512. badge: {
  513. isDot: true
  514. }
  515. }
  516. this.tabList.push(tntv)
  517. this.everyday = this.tabList.length == 2?1:2
  518. this.ytrty()
  519. this.systemmember()
  520. if (res.data.is_ios_pay == 1 && that.checkTimeLimit()) {
  521. // ios可以付钱
  522. that.show_ios_pay = true
  523. }
  524. }
  525. })
  526. },
  527. buy() {
  528. let that = this;
  529. // console.log(that.tabindex);
  530. if(that.tabindex == 0&&that.userData.vip_time == 9999){
  531. uni.showModal({
  532. confirmColor: '#26B3A0',
  533. confirmText: '确定',
  534. cancelText:'退出',
  535. title: '提示',
  536. content: '您已购买永久会员,无需再次购买',
  537. success(src) {
  538. if (src.confirm) {
  539. } else if (src.cancel) {
  540. uni.navigateBack()
  541. }
  542. }
  543. });
  544. return
  545. }
  546. that.$http('order.create', {
  547. pay_type: 'wechat',
  548. link_id: that.list[that.current].id
  549. }).then(res => {
  550. if (res.code === 0) {
  551. if(that.userInfo.openid_miniapp || that.userInfo.openid_wechat){
  552. let pay = new ShoproPay('wechat', res.data,0);
  553. }else{
  554. // console.log(res.data);
  555. that.paytest(res.data.order_number,res.data.id)
  556. }
  557. } else {
  558. that.$u.toast(res.msg);
  559. }
  560. });
  561. },
  562. paytest(e,id){
  563. uni.showLoading({
  564. title:'支付跳转中...'
  565. })
  566. let uniacid = uni.getStorageSync("uniacid") || "";
  567. this.$http('pay.hupijiaopay', {
  568. order_number:e,
  569. is_commission:0,
  570. return_url:window.location.href.split('/h5')[0]+'/h5/pages/user/public/paymentdetail?uniacid='+uniacid+'&orderType=0&orderId='+id,
  571. callback_url:window.location.href,
  572. }).then(res => {
  573. // console.log(res);
  574. if (res.code === 0) {
  575. // console.log(res.data);
  576. window.location.href = res.data.url
  577. // uni.navigateTo({
  578. // url:'pages/user/public/webview?url='+res.data.url
  579. // })
  580. } else {
  581. this.$u.toast(res.msg);
  582. }
  583. });
  584. },
  585. gettabs(e) {
  586. // console.log(e.index);
  587. this.tabindex = e.index
  588. if(this.tabList.length == 3){
  589. this.list = []
  590. if (e.index < 2) {
  591. // this.type = e.id
  592. this.current = 0
  593. this.memberlist(e.id);
  594. }
  595. }else{
  596. this.list = []
  597. if (e.index < 1) {
  598. // this.type = e.id
  599. this.current = 0
  600. this.memberlist(e.id);
  601. }
  602. }
  603. },
  604. getrecord() {
  605. uni.navigateTo({
  606. url: '/pages/user/member/record'
  607. })
  608. },
  609. goBack() {
  610. uni.navigateBack({
  611. })
  612. },
  613. goHome() {
  614. uni.switchTab({
  615. url: '/pages/index'
  616. })
  617. },
  618. memberaddCoin(e) {
  619. this.$http('member.addCoin', {
  620. type: e,
  621. }).then(res => {
  622. if (res.code === 0) {
  623. if (e == 'sign') {
  624. uni.showToast({
  625. title: (this.appInfo.number_alias?this.appInfo.number_alias+' +':'点数 +') + this.plan.sign
  626. })
  627. }
  628. if (e == 'share') {
  629. setTimeout(() => {
  630. uni.showToast({
  631. title: (this.appInfo.number_alias?this.appInfo.number_alias+' +':'点数 +') + this.plan.share
  632. })
  633. }, 1000)
  634. }
  635. this.getUserData();
  636. }
  637. });
  638. },
  639. checkTimeLimit() {
  640. if (this.plan.open_period == 1) {
  641. return true;
  642. } else {
  643. if (this.time_range('8:00', '20:00')) {
  644. return false;
  645. } else {
  646. return true;
  647. }
  648. }
  649. },
  650. time_range(beginTime, endTime) {
  651. var strb = beginTime.split(':');
  652. if (strb.length != 2) {
  653. return false;
  654. }
  655. var stre = endTime.split(':');
  656. if (stre.length != 2) {
  657. return false;
  658. }
  659. var b = new Date();
  660. var e = new Date();
  661. var n = new Date();
  662. b.setHours(strb[0]);
  663. b.setMinutes(strb[1]);
  664. e.setHours(stre[0]);
  665. e.setMinutes(stre[1]);
  666. if (n.getTime() - b.getTime() > 0 && n.getTime() - e.getTime() < 0) {
  667. return true;
  668. } else {
  669. return false;
  670. }
  671. }
  672. }
  673. }
  674. </script>
  675. <style lang="scss" scoped>
  676. /* 胶囊*/
  677. .tn-custom-nav-bar__back {
  678. width: 100%;
  679. height: 100%;
  680. position: relative;
  681. display: flex;
  682. justify-content: space-evenly;
  683. align-items: center;
  684. box-sizing: border-box;
  685. background-color: rgba(0, 0, 0, 0.03);
  686. border-radius: 1000rpx;
  687. border: 1rpx solid rgba(255, 255, 255, 0.5);
  688. color: #FFFFFF;
  689. font-size: 18px;
  690. .icon {
  691. display: block;
  692. flex: 1;
  693. margin: auto;
  694. text-align: center;
  695. }
  696. &:before {
  697. content: " ";
  698. width: 1rpx;
  699. height: 110%;
  700. position: absolute;
  701. top: 22.5%;
  702. left: 0;
  703. right: 0;
  704. margin: auto;
  705. transform: scale(0.5);
  706. transform-origin: 0 0;
  707. pointer-events: none;
  708. box-sizing: border-box;
  709. opacity: 0.05;
  710. background-color: #fff;
  711. }
  712. }
  713. .title-text {
  714. color: #fff;
  715. }
  716. .user-avatar {
  717. width: 140rpx;
  718. height: 140rpx;
  719. border-radius: 50%;
  720. }
  721. .ico-vip {
  722. width: 28rpx;
  723. height: 28rpx;
  724. }
  725. .form {
  726. margin: 0 30rpx 60rpx;
  727. }
  728. .form-choice {
  729. margin: 20rpx 0;
  730. padding: 30rpx 40rpx;
  731. // height: 164rpx;
  732. background-color: #f5f5f5;
  733. border-radius: 14rpx;
  734. position: relative;
  735. }
  736. .form-choice.active {
  737. color: #ffffff;
  738. // background-color: #26B3A0;
  739. background: linear-gradient(to right, #00ca88, #00BCD4);
  740. }
  741. .ico-special {
  742. width: 158rpx;
  743. height: 48rpx;
  744. }
  745. .explain {
  746. margin: 20rpx 0 20rpx;
  747. }
  748. .explain-title {
  749. margin: 0 0 40rpx;
  750. }
  751. .explain-item {
  752. flex-grow: 1;
  753. text-align: center;
  754. }
  755. .kf_qrcode{
  756. margin-bottom: 20rpx;
  757. }
  758. .ico-explain {
  759. padding: 18rpx;
  760. width: 80rpx;
  761. height: 80rpx;
  762. background-color: #f5f5f5;
  763. border-radius: 50%;
  764. }
  765. .bottom-page {
  766. position: fixed;
  767. bottom: 0;
  768. left: 0;
  769. padding: 0 40rpx 20rpx;
  770. width: 100%;
  771. box-sizing: border-box;
  772. background-color: #F5F5F5;
  773. }
  774. .ico-check {
  775. width: 28rpx;
  776. height: 28rpx;
  777. }
  778. .bottom-btn {
  779. margin: 20rpx 0;
  780. width: 200rpx;
  781. height: 84rpx;
  782. font-weight: bold;
  783. line-height: 84rpx;
  784. text-align: center;
  785. color: #ffffff;
  786. background: linear-gradient(to right, #00ca88, #00BCD4);
  787. border-radius: 42rpx;
  788. }
  789. .flex-rb-cc {
  790. display: flex;
  791. align-items: center;
  792. justify-content: space-between;
  793. }
  794. .flex-cc {
  795. display: flex;
  796. align-items: center;
  797. }
  798. .ml20 {
  799. margin-left: 30rpx;
  800. width: 100%;
  801. }
  802. .mb10 {
  803. margin: 10rpx;
  804. }
  805. .fz-24 {
  806. font-size: 24rpx;
  807. }
  808. .fz-38 {
  809. font-size: 38rpx;
  810. }
  811. .mt10 {
  812. margin-top: 10rpx;
  813. }
  814. .fc-999 {
  815. color: #999;
  816. }
  817. .fz-32 {
  818. font-size: 32rpx;
  819. }
  820. .fz-48 {
  821. font-size: 48rpx;
  822. }
  823. .pricefont {
  824. font-weight: bold;
  825. }
  826. .bold {
  827. font-weight: bold;
  828. }
  829. .fc-white5 {
  830. color: white;
  831. }
  832. .fc-c5 {
  833. color: #ccc;
  834. // color: #9e9e9e;
  835. }
  836. .line-through {
  837. text-decoration-line: line-through;
  838. margin-right: 10rpx;
  839. }
  840. .form-special{
  841. // position: absolute;
  842. // left: 0;
  843. // top: 0;
  844. font-size: 24rpx;
  845. }
  846. .selected {
  847. color: #ffeb3b;
  848. }
  849. .fz-42 {
  850. font-size: 42rpx;
  851. }
  852. .tr {
  853. display: flex;
  854. // flex-direction: column;
  855. align-items: flex-end;
  856. }
  857. .task-item {
  858. margin: 30rpx;
  859. padding: 30rpx;
  860. border-radius: 14rpx;
  861. background-color: #f5f5f5;
  862. .task-content {
  863. font-size: 16px;
  864. font-weight: bold;
  865. margin-bottom: 12rpx;
  866. }
  867. .task-frequency {
  868. color: #f9ae3d;
  869. }
  870. .task-button {
  871. background: linear-gradient(to right, #00ca88, #00BCD4);
  872. color: #fff;
  873. padding: 12rpx 22rpx;
  874. font-size: 25rpx;
  875. border-radius: 30rpx;
  876. }
  877. .task-buttons {
  878. background: #9e9e9e;
  879. color: #fff;
  880. padding: 12rpx 22rpx;
  881. font-size: 25rpx;
  882. border-radius: 30rpx;
  883. }
  884. }
  885. .share-button {
  886. position: absolute;
  887. width: 70px;
  888. height: 28px;
  889. border-radius: 30rpx;
  890. right: 60rpx;
  891. opacity: 0;
  892. }
  893. .cu-dialog {
  894. position: fixed;
  895. top: 60rpx;
  896. left: 100rpx;
  897. }
  898. .guide-img {
  899. width: 580rpx;
  900. height: 430rpx;
  901. }
  902. .packagetag{
  903. margin-right: 15rpx;
  904. margin-top: 15rpx;
  905. }
  906. </style>