index.vue 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598
  1. <template>
  2. <app-layout>
  3. <view @click="toDetail">
  4. <view class='nav'>
  5. <image load-lazy='true' class='yuan' src='/static/image/step/yuan.png'></image>
  6. <text>我的{{setting.currency_name ? setting.currency_name : '活力币'}}<text style='color:#ff9d1e;'>{{user_data.step_currency ? user_data.step_currency : 0}}</text></text>
  7. <image load-lazy='true' class='to-log' src='/static/image/icon/arrow-right.png'></image>
  8. </view>
  9. </view>
  10. <view class='today-step'>
  11. <view class='rule' @click="toRules">
  12. <view>规则</view>
  13. </view>
  14. <view @click="toTop" class='today-top'>
  15. <image load-lazy='true' src='/static/image/step/top.png'></image>
  16. </view>
  17. <view @click="toIndex" class='today-index'>
  18. <image load-lazy='true' src='/static/image/step/index.png'></image>
  19. </view>
  20. <image load-lazy='true' class='step-bg' :src='stepImg.app_image.bg'></image>
  21. <view @click="exchange" class='step-btn'>
  22. <view>今日可兑步数</view>
  23. <view class='step-num'>{{user_data.daily_num ? user_data.daily_num : 0}}</view>
  24. <view>点击兑换</view>
  25. <view class='step-tip'>每日零点清零</view>
  26. </view>
  27. <view class='get-now' @click="refresh">
  28. <image load-lazy='true' src="/static/image/step/refresh.png"></image>
  29. <text>同步最新步数</text>
  30. </view>
  31. <view class="invite-btn" @click="showHiddenClick">
  32. <view class='invite'>邀请好友获得永久步数加成</view>
  33. </view>
  34. </view>
  35. <view class='friend'>
  36. <view class='friend-left' style="line-height: 1.2">
  37. <view>好友</view>
  38. <view>助力</view>
  39. </view>
  40. <view class='friend-list'>
  41. <view style="display: inline-block" v-for="(item, index) in invite_list" :key="index" @click="showHiddenClick">
  42. <image load-lazy='true' :src='item.avatar'></image>
  43. </view>
  44. <view class='look-more'>
  45. <view @click="toFriend" style="line-height: 1.2">
  46. <view>查看</view>
  47. <view>更多</view>
  48. <image load-lazy='true' src='/static/image/icon/arrow-right.png'></image>
  49. </view>
  50. </view>
  51. </view>
  52. <view style='margin: #{22rpx} 0 #{6rpx};'>
  53. 总邀请{{user_data.all_invite ? user_data.all_invite : 0}}人,今日邀请{{user_data.daily_invite_num ?
  54. user_data.daily_invite_num : 0}}人
  55. </view>
  56. <view>当前步数加成{{user_data.daily_ratio ? user_data.daily_ratio : 0}}%,明天步数加成{{ user_data.ratio ?
  57. user_data.ratio : 0}}%
  58. </view>
  59. </view>
  60. <!-- 流量主 -->
  61. <app-ad v-if="ad_data.unit_id"
  62. :unit-id="ad_data.unit_id"
  63. :type="ad_data.type"
  64. :video-url="ad_data.video_url"
  65. :pic-url="ad_data.pic_url"
  66. :coupon-url="coupon_url"
  67. :coupon-params="ad_data | getObje(ad_data)"
  68. />
  69. <view class='everyday'>
  70. <view class='everyday-title'>每日兑换提醒</view>
  71. <view>{{setting.currency_name ? setting.currency_name : '活力币'}}可兑换礼物,记得每天来看看哟~</view>
  72. <view @click="openMsg" class='switch'>
  73. <switch style="transform:scale(0.7)" @change='toSwitch' :checked="user_data.is_remind == 1"></switch>
  74. </view>
  75. </view>
  76. <view v-if="banner_list.length" class='banner' indicator-dots="true" autoplay="true">
  77. <swiper class="swiper" indicator-dots="true" autoplay="true">
  78. <swiper-item v-for="(item, index) in banner_list" :key="index">
  79. <app-jump-button :open_type="item.open_type" :url="item.page_url" :params="item.params">
  80. <image mode="aspectFill" :src="item.pic_url"></image>
  81. </app-jump-button>
  82. </swiper-item>
  83. </swiper>
  84. </view>
  85. <view class='dare'>
  86. <view class='dare-banner'>
  87. <view class='dare-title'>步数挑战</view>
  88. <view class='dare-date' v-if='activity_data.id > 0 && activity_data.now_time_status == false'>{{activity_data.begin_at}}开始</view>
  89. <view class='dare-date' v-if='activity_data.id > 0 && activity_data.now_time_status == true'>{{activity_data.title}}进行中</view>
  90. <view @click="toDare">
  91. <view class='dare-right'>
  92. <text>更多</text>
  93. <image load-lazy='true' src='/static/image/icon/arrow-right.png'></image>
  94. </view>
  95. </view>
  96. </view>
  97. <view class='dare-item' v-if="activity_data.id > 0">
  98. <view class='item-img'>
  99. <image load-lazy='true' src='/static/image/step/dare.png'></image>
  100. </view>
  101. <view class='dare-info' v-if="activity_data.now_time_status == true && activity_data.log_status == null">
  102. <view>奖金池总额</view>
  103. <view class='info-num'>{{activity_data.total_currency}}</view>
  104. <view>达标人数</view>
  105. <view class='info-num'>{{activity_data.people_reach_num}}</view>
  106. </view>
  107. <view class='item' v-if="activity_data.now_time_status == false || activity_data.log_status > -1 ">
  108. <view class='target-step'>目标步数
  109. <text>{{activity_data.step_num}}</text> 步
  110. </view>
  111. <view v-if='activity_data.now_time_status == false'>
  112. <view class='dare-gold'>挑战保证金
  113. <text>{{activity_data.bail_currency}}{{setting.currency_name ? setting.currency_name : '活力币'}}</text>
  114. </view>
  115. <view>已有{{activity_data.people_num}}人参加</view>
  116. </view>
  117. <view class='target-step' v-if='activity_data.now_time_status == true'>
  118. 已完成<text v-if="activity_data.log_status === '0'">{{user_data.daily_real_num}}</text>
  119. <text v-if="activity_data.log_status > 0">{{activity_data.user_total_num}}</text>步
  120. </view>
  121. <view @click="toDare(activity_data.id,activity_data.step_num)">
  122. <button class='join' v-if='activity_data.log_status == 0 && activity_data.now_time_status == true && user_data.daily_real_num > activity_data.step_num-1'>提交成绩</button>
  123. </view>
  124. <view class='start' v-if='activity_data.log_status == 0 && activity_data.now_time_status == true'>距目标越来越近了,加油哦~</view>
  125. <button class='join-over' v-if='activity_data.log_status == 0 && activity_data.now_time_status == false' open-type="share">已参赛,邀请好友</button>
  126. <button class='submit-over' v-if='activity_data.log_status == 1'>已提交成绩</button>
  127. <view @click="toJoin(activity_data.id)">
  128. <button class='join' v-if='activity_data.log_status == null && activity_data.now_time_status == false'>立即参加</button>
  129. </view>
  130. </view>
  131. </view>
  132. <view class='no-dare' v-else>
  133. <image load-lazy='true' src='/static/image/step/none.png'></image>
  134. <view>暂无挑战赛哦</view>
  135. </view>
  136. </view>
  137. <view class='exchange-title'>
  138. <image load-lazy='true' src='/static/image/step/exchange.png'></image>
  139. <text>免费兑换</text>
  140. </view>
  141. <view class='good-list dir-left-wrap'>
  142. <view class='good-item' v-for="(good, index) in goods" :key="index" @click="toGoods(good)">
  143. <view class="out-dialog" v-if="good.count_stock == 0 && appSetting.is_show_stock == '1'">
  144. <image :src="appSetting.is_use_stock == '1' ? appImg.plugins_out : appSetting.sell_out_pic"></image>
  145. </view>
  146. <image class="goods-cover" load-lazy='true' :src='good.cover_pic'></image>
  147. <view class='good-info'>
  148. <!-- #ifdef MP-ALIPAY -->
  149. <view class='good-name t-omit-two' style="line-height: 1.3">{{good.name}}</view>
  150. <!-- #endif -->
  151. <!-- #ifndef MP-ALIPAY -->
  152. <view class='good-name t-omit-two'>{{good.name}}</view>
  153. <!-- #endif -->
  154. <view :style="{'color': getTheme.color}" class='good-price dir-left-nowrap cross-center'>
  155. <image load-lazy='true' src='/static/image/step/detail-price.png'></image>
  156. <view class="cross-bottom">{{good.min_currency}}</view>
  157. <view v-if="good.max_currency > good.min_currency" style="align-self: flex-end;font-size: #{22rpx};padding-bottom:#{2rpx};">起</view>
  158. <view style="font-size: #{25rpx};">+</view>
  159. <view>¥{{good.min_price}}</view>
  160. <view v-if="good.max_price > good.min_price" style="align-self: flex-end;font-size: #{22rpx};padding-bottom:#{2rpx};">起</view>
  161. </view>
  162. <view class="main-between goods-other-info">
  163. <view>¥{{good.original_price}}</view>
  164. <view>仅剩{{good.count_stock}}件</view>
  165. </view>
  166. <button v-if="good.count_stock > 0" :style="{'background': good.buy_goods_auth ? getTheme.background_gradient_btn : '#999999','color': good.buy_goods_auth ? getTheme.main_text : ''}" class="good-exchange">立即兑换</button>
  167. <button v-else class="good-exchange" style="background: #CDCDCD;color: #fff;">已售罄</button>
  168. </view>
  169. </view>
  170. </view>
  171. <view class="bg main-center" v-if="toExchange">
  172. <view class="dialog">
  173. <view>确定将
  174. <text style='color: #ff4544'>{{user_data.daily_num}}</text>步兑换为
  175. <text style='color: #ff4544'>{{exchangNum}}</text>{{setting.currency_name ? setting.currency_name : '活力币'}}?</view>
  176. <view class="dialog-btn main-between">
  177. <view class="close-btn" @click="toExchange=false">取消</view>
  178. <view class="line"></view>
  179. <view class="submit-btn" @click="subscribe">确认</view>
  180. </view>
  181. </view>
  182. </view>
  183. <view class="share-qr-code-poster" v-if="showShare">
  184. <view class="app-bottom">
  185. <view class="app-icons dir-left-nowrap">
  186. <view class="box-grow-1" @click="showHiddenClick">
  187. <app-jump-button form arrangement="topCenter" open_type="share">
  188. <icon class="app-icon app-share" type></icon>
  189. <text class="app-text">发送给朋友</text>
  190. </app-jump-button>
  191. </view>
  192. <view class="box-grow-1">
  193. <app-form-id @click="toShare(user_data.daily_num)">
  194. <view class="dir-top-wrap main-center cross-center">
  195. <icon class="app-icon app-code" type></icon>
  196. <text class="app-text">生成邀请海报</text>
  197. </view>
  198. </app-form-id>
  199. </view>
  200. </view>
  201. <view class="app-button">
  202. <app-form-id>
  203. <view style="height: 100rpx;background-color: #ffffff;text-align: center;line-height: 100rpx;font-size: 32rpx;color: #353535;" @click="showHiddenClick" type="general">取消</view>
  204. </app-form-id>
  205. </view>
  206. <view v-if="getBoolEmpty.XBoolean" :style="{height: getBoolEmpty.emptyHeight + 'rpx',}"></view>
  207. </view>
  208. </view>
  209. </app-layout>
  210. </template>
  211. <script>
  212. import appAd from '../../../components/page-component/app-ad/app-ad';
  213. import {mapGetters, mapState} from "vuex";
  214. export default {
  215. data() {
  216. return {
  217. showShare: false,
  218. user_id: 0,
  219. share_title: '',
  220. setting: {},
  221. first: false,
  222. activity_data: {},
  223. ad_data: {},
  224. page: 1,
  225. template_remind: '',
  226. template_activity: '',
  227. banner_list: {},
  228. toExchange: false,
  229. authorize: false,
  230. exchangNum: 0,
  231. user_data: {
  232. daily_num: 0
  233. },
  234. goods: [],
  235. loading: false,
  236. invite_list: [{
  237. avatar: '/static/image/step/friend.png'
  238. },
  239. {
  240. avatar: '/static/image/step/friend.png'
  241. },
  242. {
  243. avatar: '/static/image/step/friend.png'
  244. },
  245. {
  246. avatar: '/static/image/step/friend.png'
  247. }
  248. ],
  249. coupon_url: this.$api.step.receive,
  250. disable: 'disable'
  251. }
  252. },
  253. components: {
  254. appAd
  255. },
  256. computed: {
  257. ...mapState({
  258. stepImg: state => state.mallConfig.plugin.step,
  259. appImg: state => state.mallConfig.__wxapp_img.mall,
  260. appSetting: state => state.mallConfig.mall.setting,
  261. userInfo: state => state.user.info,
  262. platform: function(state) {
  263. return state.gConfig.systemInfo.platform;
  264. }
  265. }),
  266. ...mapGetters('mallConfig', {
  267. getVideo: 'getVideo',
  268. getTheme: 'getTheme'
  269. }),
  270. ...mapGetters('iPhoneX', {
  271. getBoolEmpty: 'getBoolEmpty'
  272. })
  273. },
  274. filters: {
  275. getObje(data, temp) {
  276. return {
  277. id: data.id
  278. }
  279. }
  280. },
  281. methods: {
  282. showHiddenClick() {
  283. this.showShare = !this.showShare;
  284. },
  285. toIndex() {
  286. uni.redirectTo({
  287. url: '/pages/index/index'
  288. });
  289. },
  290. toDetail() {
  291. uni.navigateTo({
  292. url: '/plugins/step/detail/detail'
  293. });
  294. },
  295. toShare(num) {
  296. this.showShare = false;
  297. uni.navigateTo({
  298. url: '/plugins/step/share/share?step=' + num
  299. });
  300. },
  301. toRules() {
  302. // uni.navigateTo({
  303. // url: '/plugins/step/rules/rules?rule=1'
  304. // });
  305. uni.navigateTo({
  306. url: `/pages/rules/index?url=${encodeURIComponent(this.$api.step.setting)}&key=rule`,
  307. });
  308. },
  309. toTop() {
  310. uni.navigateTo({
  311. url: '/plugins/step/top/top'
  312. });
  313. },
  314. toFriend() {
  315. uni.navigateTo({
  316. url: '/plugins/step/friend/friend'
  317. });
  318. },
  319. toDare(id,num) {
  320. if(id && num) {
  321. uni.navigateTo({
  322. url: '/plugins/step/dare/dare?submit=1&activity_id=' + id +'&step_num=' + num
  323. });
  324. }else {
  325. uni.navigateTo({
  326. url: '/plugins/step/dare/dare'
  327. })
  328. }
  329. },
  330. toJoin(id) {
  331. uni.navigateTo({
  332. url: '/plugins/step/join/join?id=' + id
  333. });
  334. },
  335. toGoods(data) {
  336. // #ifndef MP-BAIDU || H5
  337. if (data.video_url && this.getVideo == 1) {
  338. uni.navigateTo({
  339. url: `/pages/goods/video?goods_id=${data.goods_id}&sign=step`
  340. });
  341. } else {
  342. uni.navigateTo({
  343. url: '/plugins/step/goods/goods?goods_id=' + data.goods_id
  344. });
  345. }
  346. // #endif
  347. // #ifdef H5
  348. uni.navigateTo({
  349. url: '/plugins/step/goods/goods?goods_id=' + data.goods_id
  350. });
  351. // #endif
  352. // #ifdef MP-BAIDU
  353. uni.navigateTo({
  354. url: '/plugins/step/goods/goods?goods_id=' + data.id
  355. });
  356. // #endif
  357. },
  358. getAuth() {
  359. let that = this;
  360. uni.getSetting({
  361. success(res) {
  362. if (res.authSetting['scope.werun'] == true) {
  363. that.page = 1;
  364. that.runData();
  365. that.getGoods();
  366. } else {
  367. uni.authorize({
  368. scope: 'scope.werun',
  369. success(res) {
  370. if (res.errMsg == "authorize:ok") {
  371. that.page = 1;
  372. // 读取数据
  373. that.runData();
  374. that.getGoods();
  375. }
  376. },
  377. fail(res) {
  378. that.$hideLoading();
  379. uni.showModal({
  380. title: '提示',
  381. content: '获取步数信息失败,需要授权获取步数权限',
  382. showCancel: false,
  383. confirmText: '打开授权',
  384. success(e) {
  385. if (e.confirm) {
  386. uni.openSetting({});
  387. }
  388. }
  389. });
  390. }
  391. });
  392. }
  393. }
  394. })
  395. },
  396. aliAuth(today) {
  397. let that = this;
  398. let inviteList = [{
  399. avatar: '/static/image/step/friend.png'
  400. },
  401. {
  402. avatar: '/static/image/step/friend.png'
  403. },
  404. {
  405. avatar: '/static/image/step/friend.png'
  406. },
  407. {
  408. avatar: '/static/image/step/friend.png'
  409. }
  410. ]
  411. if(that.user_id == 0 && that.userInfo) {
  412. that.user_id = that.userInfo.options.user_id;
  413. }
  414. my.getRunData({
  415. countDate: today,
  416. success: (res) => {
  417. that.$request({
  418. url: that.$api.step.index,
  419. data: {
  420. encrypted_data: res.response,
  421. parent_id: that.user_id,
  422. page: 1
  423. },
  424. method: 'POST',
  425. }).then(response=>{
  426. that.$hideLoading();
  427. if (response.code == 0) {
  428. console.log(response,">>>>>>>>>>>")
  429. that.template_remind = response.data.template_remind;
  430. that.template_activity = response.data.template_activity;
  431. that.activity_data = response.data.activity_data;
  432. that.ad_data = response.data.ad_data;
  433. that.banner_list = response.data.banner_list;
  434. that.user_data = response.data.user_data;
  435. that.invite_list = that.user_data.invite_list.concat(inviteList).slice(0, 4);
  436. that.first = true;
  437. } else {
  438. uni.showToast({
  439. title: response.msg,
  440. icon: 'none',
  441. duration: 1000
  442. });
  443. }
  444. }).catch(response => {
  445. that.$hideLoading();
  446. that.$event.on(that.$const.EVENT_USER_LOGIN).then(()=>{
  447. that.aliAuth(today);
  448. });
  449. });
  450. },
  451. fail: (res) => {
  452. uni.showModal({
  453. content: res.errMsg,
  454. showCancel: false,
  455. });
  456. }
  457. });
  458. },
  459. runData() {
  460. let that = this;
  461. let code, iv, encrypted_data;
  462. let inviteList = [{
  463. avatar: '/static/image/step/friend.png'
  464. },
  465. {
  466. avatar: '/static/image/step/friend.png'
  467. },
  468. {
  469. avatar: '/static/image/step/friend.png'
  470. },
  471. {
  472. avatar: '/static/image/step/friend.png'
  473. }
  474. ]
  475. uni.login({
  476. success(res) {
  477. if(that.user_id == 0 && that.userInfo) {
  478. that.user_id = that.userInfo.options.user_id;
  479. }
  480. code = res.code;
  481. // 获取iv和encryptedData
  482. uni.getWeRunData({
  483. success(res) {
  484. iv = res.iv;
  485. encrypted_data = res.encryptedData;
  486. that.$request({
  487. url: that.$api.step.index,
  488. data: {
  489. encrypted_data: encrypted_data,
  490. iv: iv,
  491. parent_id: that.user_id,
  492. code: code,
  493. page: 1
  494. },
  495. method: 'POST',
  496. }).then(response=>{
  497. that.$hideLoading();
  498. if (response.code == 0) {
  499. that.template_remind = response.data.template_remind;
  500. that.template_activity = response.data.template_activity;
  501. that.activity_data = response.data.activity_data;
  502. that.ad_data = response.data.ad_data;
  503. that.banner_list = response.data.banner_list;
  504. that.user_data = response.data.user_data;
  505. that.invite_list = that.user_data.invite_list.concat(inviteList).slice(0, 4);
  506. that.first = true;
  507. } else {
  508. uni.showToast({
  509. title: response.msg,
  510. icon: 'none',
  511. duration: 1000
  512. });
  513. }
  514. }).catch(response => {
  515. that.$hideLoading();
  516. that.$event.on(that.$const.EVENT_USER_LOGIN).then(()=>{
  517. that.runData();
  518. });
  519. });
  520. },
  521. fail(res) {
  522. if (res.errMsg == 'getWeRunData:fail cancel') {
  523. uni.showModal({
  524. content: '读取失败,请稍后再试',
  525. showCancel: false,
  526. });
  527. } else if (res.errMsg == 'getWeRunData: fail device not support') {
  528. uni.showModal({
  529. content: '请在微信中搜索"微信运动"公众号,并点击关注',
  530. showCancel: false,
  531. });
  532. } else {
  533. uni.showModal({
  534. content: res.errMsg,
  535. showCancel: false,
  536. });
  537. }
  538. }
  539. })
  540. }
  541. })
  542. },
  543. getGoods() {
  544. let that = this;
  545. that.$request({
  546. url: that.$api.step.goods,
  547. data: {
  548. page: that.page
  549. },
  550. }).then(response=>{
  551. if(response.code == 0) {
  552. that.goods = that.goods.concat(response.data.list);
  553. that.page++;
  554. }else {
  555. uni.showToast({
  556. title: response.msg,
  557. icon: 'none',
  558. duration: 1000
  559. });
  560. }
  561. }).catch(response => {
  562. that.$hideLoading();
  563. });
  564. },
  565. refresh() {
  566. this.$showLoading({
  567. type: 'global',
  568. text: '步数加载中...'
  569. });
  570. // #ifdef MP-WEIXIN
  571. this.runData();
  572. // #endif
  573. // #ifdef MP-ALIPAY
  574. var myDate = new Date();
  575. let year = myDate.getFullYear();
  576. let month = myDate.getMonth() + 1;
  577. if (month >= 1 && month <= 9) {
  578. month = "0" + month;
  579. }
  580. let now = myDate.getDate();
  581. let today = year + "-" + month + "-" + now;
  582. this.aliAuth(today);
  583. // #endif
  584. },
  585. openMsg() {
  586. if(this.user_data.is_remind == 0) {
  587. this.$subscribe(this.template_remind);
  588. }
  589. },
  590. toSwitch(e) {
  591. let checked = 0;
  592. if (e.detail.value) {
  593. checked = 1
  594. }
  595. let that = this;
  596. this.$request({
  597. url: this.$api.step.remind,
  598. data: {
  599. is_remind: checked
  600. },
  601. method: 'post',
  602. }).then(response => {
  603. if (response.code == 0) {
  604. this.user_data.is_remind = checked;
  605. }
  606. }).catch(response => {
  607. });
  608. },
  609. exchange() {
  610. let that = this;
  611. let convert_ratio = +that.setting.convert_ratio;
  612. let daily_real_num = +that.user_data.daily_real_num;
  613. let daily_num = +that.user_data.daily_num;
  614. let num = 0;
  615. if (convert_ratio > 0) {
  616. num = (daily_num / convert_ratio).toFixed(2);
  617. }
  618. if (daily_num < 1 || num < 0.01) {
  619. uni.showToast({
  620. title: '可兑换步数不足',
  621. icon: 'none',
  622. duration: 1000
  623. });
  624. } else {
  625. that.toExchange = true;
  626. that.exchangNum = num;
  627. that.$forceUpdate();
  628. }
  629. },
  630. subscribe() {
  631. if(this.loading) {
  632. return false;
  633. }
  634. this.loading = true;
  635. this.$subscribe(this.template_remind).then(res => {
  636. this.exchangeSubmit();
  637. }).catch(res => {
  638. this.exchangeSubmit();
  639. });
  640. },
  641. exchangeRequest(num, code, encrypted_data, iv) {
  642. let that = this;
  643. that.$request({
  644. url: that.$api.step.convert,
  645. data: {
  646. num: num,
  647. code: code,
  648. encrypted_data: encrypted_data,
  649. iv: iv,
  650. },
  651. method: 'post',
  652. }).then(response => {
  653. that.loading = false;
  654. uni.hideLoading();
  655. if (response.code == 0) {
  656. uni.showToast({
  657. title: "兑换成功",
  658. icon: 'success',
  659. duration: 1000
  660. });
  661. setTimeout(function(){
  662. // #ifdef MP-WEIXIN
  663. that.runData();
  664. // #endif
  665. // #ifdef MP-ALIPAY
  666. var myDate = new Date();
  667. let year = myDate.getFullYear();
  668. let month = myDate.getMonth() + 1;
  669. if (month >= 1 && month <= 9) {
  670. month = "0" + month;
  671. }
  672. let now = myDate.getDate();
  673. let today = year + "-" + month + "-" + now;
  674. that.aliAuth(today);
  675. // #endif
  676. },1000)
  677. } else {
  678. uni.showToast({
  679. title: response.msg,
  680. icon: 'none',
  681. duration: 1000
  682. });
  683. }
  684. }).catch(response => {
  685. that.loading = false;
  686. uni.hideLoading();
  687. });
  688. },
  689. exchangeSubmit() {
  690. let that = this;
  691. let num = this.user_data.daily_real_num;
  692. let code, iv, encrypted_data;
  693. that.toExchange = false;
  694. // #ifdef MP-ALIPAY
  695. var myDate = new Date();
  696. let year = myDate.getFullYear();
  697. let month = myDate.getMonth() + 1;
  698. if (month >= 1 && month <= 9) {
  699. month = "0" + month;
  700. }
  701. let now = myDate.getDate();
  702. let today = year + "-" + month + "-" + now;
  703. // #endif
  704. uni.showLoading({
  705. mask: true,
  706. title: '兑换中...'
  707. });
  708. uni.login({
  709. success(res) {
  710. code = res.code;
  711. // 获取iv和encryptedData
  712. // #ifndef MP-ALIPAY
  713. uni.getWeRunData({
  714. success(res) {
  715. iv = res.iv;
  716. encrypted_data = res.encryptedData;
  717. that.exchangeRequest(num, code, encrypted_data, iv);
  718. },
  719. fail(res) {
  720. that.loading = false;
  721. uni.hideLoading();
  722. uni.showModal({
  723. content: res.errMsg,
  724. showCancel: false,
  725. });
  726. }
  727. })
  728. // #endif
  729. // #ifdef MP-ALIPAY
  730. my.getRunData({
  731. countDate: today,
  732. success: (res) => {
  733. encrypted_data = res.response;
  734. that.exchangeRequest(num, code, encrypted_data, iv);
  735. },
  736. fail(res) {
  737. that.loading = false;
  738. uni.hideLoading();
  739. if (res.errMsg == 'getWeRunData:fail cancel') {
  740. uni.showModal({
  741. content: '读取失败,请稍后再试',
  742. showCancel: false,
  743. });
  744. } else if (res.errMsg == 'getWeRunData: fail device not support') {
  745. uni.showModal({
  746. content: '请在微信中搜索"微信运动"公众号,并点击关注',
  747. showCancel: false,
  748. });
  749. } else {
  750. uni.showModal({
  751. content: res.errMsg,
  752. showCancel: false,
  753. });
  754. }
  755. }
  756. })
  757. // #endif
  758. },
  759. fail(res) {
  760. that.loading = false;
  761. uni.hideLoading();
  762. uni.showModal({
  763. content: res.errMsg,
  764. showCancel: false,
  765. });
  766. }
  767. })
  768. },
  769. },
  770. onReachBottom() {
  771. this.getGoods();
  772. },
  773. // #ifdef MP-WEIXIN
  774. onShareTimeline() {
  775. return this.$shareTimeline({
  776. title: this.share_title ? this.share_title : this.$children[0].navigationBarTitle,
  777. query: {} // 此处填写页面的参数
  778. });
  779. },
  780. // #endif
  781. onLoad(options) { this.$commonLoad.onload(options);
  782. let that = this;
  783. // #ifdef MP-WEIXIN
  784. wx.showShareMenu({
  785. menus: ['shareAppMessage', 'shareTimeline']
  786. })
  787. // #endif
  788. that.$showLoading({
  789. type: 'global',
  790. text: '加载中...'
  791. });
  792. // #ifdef MP-BAIDU || MP-TOUTIAO
  793. uni.showModal({
  794. title: '提示',
  795. showCancel: false,
  796. content: '本平台暂不支持该插件',
  797. success: function (res) {
  798. uni.redirectTo({
  799. url: '/pages/index/index'
  800. });
  801. }
  802. });
  803. return false;
  804. // #endif
  805. this.$store.dispatch('user/info');
  806. if(options.user_id > 0) {
  807. that.user_id = options.user_id;
  808. }
  809. that.$request({
  810. url: that.$api.step.setting,
  811. }).then(response=>{
  812. // #ifdef MP-WEIXIN
  813. that.getAuth();
  814. // #endif
  815. // #ifdef MP-ALIPAY
  816. var myDate = new Date();
  817. let year = myDate.getFullYear();
  818. let month = myDate.getMonth() + 1;
  819. if (month >= 1 && month <= 9) {
  820. month = "0" + month;
  821. }
  822. let now = myDate.getDate();
  823. let today = year + "-" + month + "-" + now;
  824. that.aliAuth(today);
  825. that.getGoods();
  826. // #endif
  827. if(response.code == 0) {
  828. that.setting = response.data;
  829. that.share_title = response.data.share_title.toString();
  830. that.rules = response.data.rule;
  831. if(response.data.share_title.indexOf("\n") > -1) {
  832. let share_title = response.data.share_title.split("\n");
  833. let index = Math.floor(Math.random() * share_title.length);
  834. that.share_title = share_title[index]
  835. }
  836. }else {
  837. uni.showToast({
  838. title: response.msg,
  839. icon: 'none',
  840. duration: 1000
  841. });
  842. }
  843. }).catch(response => {
  844. that.$hideLoading();
  845. });
  846. },
  847. onShow() {
  848. let that = this;
  849. if (that.first == false) {
  850. return
  851. } else {
  852. // #ifdef MP-WEIXIN
  853. that.runData();
  854. // #endif
  855. // #ifdef MP-ALIPAY
  856. var myDate = new Date();
  857. let year = myDate.getFullYear();
  858. let month = myDate.getMonth() + 1;
  859. if (month >= 1 && month <= 9) {
  860. month = "0" + month;
  861. }
  862. let now = myDate.getDate();
  863. let today = year + "-" + month + "-" + now;
  864. that.aliAuth(today);
  865. // #endif
  866. }
  867. },
  868. // #ifdef MP
  869. onShareAppMessage() {
  870. return this.$shareAppMessage({
  871. title: this.share_title ? this.share_title : this.$children[0].navigationBarTitle,
  872. imageUrl: this.setting.share_pic ? this.setting.share_pic : '',
  873. path: "/plugins/step/index/index",
  874. params: {
  875. user_id: this.userInfo.options.user_id
  876. }
  877. });
  878. }
  879. // #endif
  880. }
  881. </script>
  882. <style scoped lang="scss">
  883. .share-qr-code-poster {
  884. width: #{750rpx};
  885. height: 100%;
  886. position: fixed;
  887. z-index: 1501;
  888. left: 0;
  889. top: 0;
  890. background-color: rgba(153, 153, 153, 0.5);
  891. .loading {
  892. width: #{220rpx};
  893. height: #{220rpx};
  894. }
  895. .app-icons {
  896. height: #{290rpx};
  897. .app-text {
  898. font-size: #{26rpx};
  899. color: #353535;
  900. }
  901. > view {
  902. width: 50%;
  903. height: 100%;
  904. .app-icon {
  905. width: #{120rpx};
  906. height: #{120rpx};
  907. background-size: cover;
  908. background-repeat: no-repeat;
  909. background-color: white;
  910. border-radius: 50%;
  911. margin-top: #{60rpx};
  912. margin-bottom: #{24rpx};
  913. }
  914. .app-share {
  915. background-image: url('../../../static/image/icon/share.png');
  916. }
  917. .app-code {
  918. background-image: url('../../../static/image/icon/code.png');
  919. }
  920. .text {
  921. font-size: #{26rpx};
  922. color: #353535;
  923. }
  924. }
  925. }
  926. .app-bottom {
  927. width: 100%;
  928. position: fixed;
  929. bottom: 0;
  930. left: 0;
  931. background-color: #f2f2f2;
  932. .app-icons {
  933. width: 100%;
  934. height: #{290rpx};
  935. }
  936. .app-button {
  937. width: 100%;
  938. height: #{100rpx};
  939. /deep/ button {
  940. border-radius: 0;
  941. border: none;
  942. }
  943. }
  944. }
  945. .app-center {
  946. width: calc(100% - #{80rpx});
  947. padding-top: #{100rpx};
  948. padding-bottom: #{77rpx};
  949. border-radius: #{8rpx};
  950. background-color: white;
  951. position: absolute;
  952. top: 50%;
  953. left: 50%;
  954. transform: translate(-50%, -50%);
  955. .app-close {
  956. width: #{30rpx};
  957. height: #{30rpx};
  958. background-size: cover;
  959. background-repeat: no-repeat;
  960. background-image: url("../../../static/image/icon/close.png");
  961. position: absolute;
  962. top: #{28rpx};
  963. right: #{24rpx};
  964. }
  965. .app-image-iframe {
  966. width: #{440rpx};
  967. height: #{783rpx};
  968. position: relative;
  969. box-shadow: #{2rpx} #{2rpx} #{10rpx} #d9d9d9;
  970. .text {
  971. text-align: center;
  972. color: #888;
  973. }
  974. }
  975. .app-button {
  976. width: #{500rpx};
  977. height: #{80rpx};
  978. margin-top: #{38rpx};
  979. margin-bottom: #{24rpx};
  980. }
  981. .app-text {
  982. font-size: #{24rpx};
  983. color: #999999;
  984. }
  985. }
  986. }
  987. .app-bottom {
  988. width: 100%;
  989. position: fixed;
  990. bottom: 0;
  991. left: 0;
  992. background-color: #f2f2f2;
  993. .app-icons {
  994. width: 100%;
  995. height: #{290rpx};
  996. }
  997. .app-button {
  998. width: 100%;
  999. height: #{100rpx};
  1000. /deep/ button {
  1001. border-radius: 0;
  1002. border: none;
  1003. }
  1004. }
  1005. }
  1006. .nav {
  1007. height: #{90rpx};
  1008. line-height: #{90rpx};
  1009. background-color: #fff;
  1010. color: #353535;
  1011. padding: 0 #{30rpx};
  1012. font-size: #{28rpx};
  1013. }
  1014. .nav .yuan {
  1015. margin-top: #{28rpx};
  1016. height: #{34rpx};
  1017. width: #{34rpx};
  1018. display: block;
  1019. float: left;
  1020. margin-right: #{10rpx};
  1021. }
  1022. .nav .to-log {
  1023. margin-top: #{34rpx};
  1024. float: right;
  1025. height: #{22rpx};
  1026. width: #{12rpx};
  1027. display: block;
  1028. }
  1029. .rule {
  1030. position: absolute;
  1031. right: 0;
  1032. top: #{40rpx};
  1033. color: white;
  1034. font-size: #{24rpx};
  1035. height: #{48rpx};
  1036. width: #{90rpx};
  1037. line-height: #{48rpx};
  1038. border-top-left-radius: #{24rpx};
  1039. border-bottom-left-radius: #{24rpx};
  1040. background-color: rgba(0, 0, 0, 0.2);
  1041. }
  1042. .today-top {
  1043. height: #{74rpx};
  1044. width: #{74rpx};
  1045. position: absolute;
  1046. top: #{40rpx};
  1047. left: #{24rpx};
  1048. }
  1049. .today-top image {
  1050. height: #{74rpx};
  1051. width: #{74rpx};
  1052. }
  1053. .today-index {
  1054. height: #{74rpx};
  1055. width: #{74rpx};
  1056. position: absolute;
  1057. top: #{144rpx};
  1058. left: #{24rpx};
  1059. }
  1060. .today-index image {
  1061. height: #{74rpx};
  1062. width: #{74rpx};
  1063. }
  1064. .today-step {
  1065. width: 100%;
  1066. height: #{720rpx};
  1067. position: relative;
  1068. text-align: center;
  1069. }
  1070. .today-step .step-bg {
  1071. width: 100%;
  1072. height: #{720rpx};
  1073. }
  1074. .step-btn {
  1075. position: absolute;
  1076. top: #{90rpx};
  1077. left: 0;
  1078. right: 0;
  1079. margin: 0 auto;
  1080. font-size: #{24rpx};
  1081. color: #353535;
  1082. height: #{294rpx};
  1083. width: #{280rpx};
  1084. text-align: center;
  1085. padding: #{48rpx} 0 #{35rpx};
  1086. }
  1087. .step-btn:active {
  1088. border-radius: #{140rpx};
  1089. background-color: rgba(0, 0, 0, 0.5);
  1090. }
  1091. .step-num {
  1092. font-family: DIN;
  1093. font-size: #{64rpx};
  1094. margin: #{8rpx} 0 #{4rpx};
  1095. }
  1096. .step-tip {
  1097. font-size: #{20rpx};
  1098. color: #999;
  1099. margin-top: #{8rpx};
  1100. }
  1101. .get-now {
  1102. position: absolute;
  1103. top: #{400rpx};
  1104. left: 0;
  1105. right: 0;
  1106. font-size: #{26rpx};
  1107. color: #666;
  1108. }
  1109. .get-now image {
  1110. height: #{24rpx};
  1111. width: #{24rpx};
  1112. margin-right: #{10rpx};
  1113. }
  1114. .invite {
  1115. background: linear-gradient(to right, #ff9d1e, #ffb81e);
  1116. height: #{80rpx};
  1117. border-radius: #{40rpx};
  1118. box-shadow: 0 0 #{20rpx} #ffb71e;
  1119. text-shadow: 0 0 #{6rpx} #ffb81e;
  1120. line-height: #{80rpx};
  1121. color: white;
  1122. width: #{500rpx};
  1123. font-size: #{30rpx};
  1124. }
  1125. .invite-btn {
  1126. position: absolute;
  1127. top: #{452rpx};
  1128. left: 0;
  1129. right: 0;
  1130. margin: 0 auto;
  1131. width: #{500rpx};
  1132. }
  1133. .friend {
  1134. position: relative;
  1135. z-index: 10;
  1136. background-color: #fff;
  1137. margin: #{-150rpx} #{24rpx} 0;
  1138. padding: #{32rpx} #{24rpx};
  1139. padding-left: 0;
  1140. text-align: center;
  1141. font-size: #{24rpx};
  1142. color: #666;
  1143. }
  1144. .friend-left {
  1145. padding: #{12rpx} 0;
  1146. font-weight: bold;
  1147. width: #{108rpx};
  1148. height: #{80rpx};
  1149. text-align: center;
  1150. font-size: #{24rpx};
  1151. background-color: #ffebd2;
  1152. color: #ff9d1e;
  1153. border-top-right-radius: #{40rpx};
  1154. border-bottom-right-radius: #{40rpx};
  1155. float: left;
  1156. margin-right: #{24rpx};
  1157. }
  1158. .friend-list image {
  1159. height: #{80rpx};
  1160. width: #{80rpx};
  1161. border-radius: 50%;
  1162. margin: 0 #{10rpx};
  1163. }
  1164. .look-more {
  1165. padding-top: #{10rpx};
  1166. margin-top: #{4rpx};
  1167. float: right;
  1168. height: #{72rpx};
  1169. width: #{120rpx};
  1170. background-color: #f2f2f2;
  1171. color: #999;
  1172. font-size: #{22rpx};
  1173. border-radius: #{36rpx};
  1174. position: relative;
  1175. }
  1176. .look-more image {
  1177. height: #{20rpx};
  1178. width: #{10rpx};
  1179. position: absolute;
  1180. right: #{13rpx};
  1181. top: #{26rpx};
  1182. }
  1183. .everyday {
  1184. margin: #{20rpx} 0;
  1185. background-color: #fff;
  1186. padding: #{24rpx};
  1187. font-size: #{24rpx};
  1188. color: #999;
  1189. position: relative;
  1190. }
  1191. .everyday-title {
  1192. font-size: #{28rpx};
  1193. color: #353535;
  1194. }
  1195. .switch {
  1196. position: absolute !important;
  1197. right: #{24rpx};
  1198. top: #{36rpx};
  1199. }
  1200. .ad {
  1201. height: #{190rpx};
  1202. width: 100%;
  1203. margin-top: #{20rpx};
  1204. margin-bottom: #{20rpx};
  1205. }
  1206. .ad form {
  1207. width: 100%;
  1208. height: #{190rpx};
  1209. }
  1210. .ad image {
  1211. width: 100%;
  1212. height: #{190rpx};
  1213. }
  1214. .banner {
  1215. margin-bottom: #{20rpx};
  1216. height: #{190rpx};
  1217. }
  1218. .banner swiper {
  1219. height: #{190rpx};
  1220. }
  1221. .banner image {
  1222. height: #{190rpx};
  1223. width: 100%;
  1224. }
  1225. .dare {
  1226. padding: #{40rpx} 0 #{40rpx} #{32rpx};
  1227. margin: 0 #{24rpx};
  1228. background-color: white;
  1229. border-radius: #{16rpx};
  1230. }
  1231. .dare-banner {
  1232. color: #666;
  1233. font-size: #{24rpx};
  1234. height: #{40rpx};
  1235. line-height: #{40rpx};
  1236. margin-bottom: #{80rpx};
  1237. }
  1238. .dare-right {
  1239. float: right;
  1240. height: #{40rpx};
  1241. line-height: #{40rpx};
  1242. margin-right: #{32rpx};
  1243. color: #666;
  1244. }
  1245. .no-dare {
  1246. margin: #{54rpx} auto 0;
  1247. width: #{300rpx};
  1248. font-size: #{30rpx};
  1249. color: #999;
  1250. text-align: center;
  1251. background-color: white;
  1252. }
  1253. .join-over {
  1254. height: #{56rpx};
  1255. width: #{280rpx};
  1256. border-radius: #{28rpx};
  1257. background-color: #fff;
  1258. color: #ff9d1e;
  1259. border: 1px solid #ff9d1e;
  1260. font-size: #{26rpx};
  1261. line-height: #{56rpx};
  1262. margin: #{18rpx} 0 #{20rpx};
  1263. }
  1264. .submit-over {
  1265. height: #{56rpx};
  1266. width: #{210rpx};
  1267. border-radius: #{28rpx};
  1268. background-color: #fff;
  1269. color: #ff9d1e;
  1270. border: 1px solid #ff9d1e;
  1271. font-size: #{26rpx};
  1272. line-height: #{56rpx};
  1273. margin: #{18rpx} 0 #{20rpx};
  1274. }
  1275. .no-dare image {
  1276. height: #{300rpx};
  1277. width: #{300rpx};
  1278. margin-bottom: #{40rpx};
  1279. }
  1280. .dare-info {
  1281. color: #999;
  1282. font-size: #{30rpx};
  1283. margin-top: #{-4rpx};
  1284. }
  1285. .info-num {
  1286. margin: #{5rpx} 0 #{26rpx};
  1287. font-size: #{44rpx};
  1288. color: #ff9d1e;
  1289. }
  1290. .dare-date {
  1291. float: left;
  1292. width: auto;
  1293. }
  1294. .dare-title {
  1295. font-size: #{34rpx};
  1296. color: #353535;
  1297. padding: 0 #{13rpx};
  1298. border-left: #{6rpx} solid #ff9d1e;
  1299. float: left;
  1300. }
  1301. .dare-banner image {
  1302. height: #{20rpx};
  1303. width: #{10rpx};
  1304. margin-left: #{12rpx};
  1305. }
  1306. .height {
  1307. height: #{20rpx};
  1308. }
  1309. .start {
  1310. color: #666;
  1311. font-size: #{24rpx};
  1312. margin-top: #{30rpx};
  1313. margin-bottom: #{30rpx};
  1314. }
  1315. .dare-item {
  1316. height: #{250rpx};
  1317. background-color: white;
  1318. }
  1319. .dare-item .item-img {
  1320. margin: #{-28rpx} #{64rpx} 0 0;
  1321. height: #{250rpx};
  1322. width: #{250rpx};
  1323. float: left;
  1324. }
  1325. .dare-item .item-img image {
  1326. width: #{250rpx};
  1327. height: #{250rpx};
  1328. }
  1329. .dare-item .item {
  1330. color: #666;
  1331. height: #{250rpx};
  1332. float: left;
  1333. width: 52.5%;
  1334. }
  1335. .target-step {
  1336. color: #353535;
  1337. height: #{56rpx};
  1338. line-height: #{28rpx};
  1339. font-size: #{30rpx};
  1340. margin-bottom: #{18rpx};
  1341. }
  1342. .target-step text {
  1343. font-size: #{46rpx};
  1344. color: #ff4544;
  1345. font-family: 'DIN';
  1346. }
  1347. .dare-gold {
  1348. margin-top: #{-5rpx};
  1349. margin-bottom: #{8rpx};
  1350. font-size: #{26rpx};
  1351. }
  1352. .dare-gold text {
  1353. color: #ff9d1e;
  1354. }
  1355. .join {
  1356. height: #{56rpx};
  1357. width: #{200rpx};
  1358. border-radius: #{28rpx};
  1359. background-color: #ff9d1e;
  1360. color: #fff;
  1361. font-size: #{26rpx};
  1362. line-height: #{56rpx};
  1363. margin: #{18rpx} 0 #{20rpx};
  1364. }
  1365. .join::after {
  1366. border: 0;
  1367. }
  1368. .exchange-title {
  1369. font-size: #{30rpx};
  1370. color: #353535;
  1371. margin: #{20rpx} auto #{10rpx};
  1372. text-align: center;
  1373. height: #{96rpx};
  1374. background-color: white;
  1375. position: relative;
  1376. }
  1377. .exchange-title image {
  1378. width: #{320rpx};
  1379. height: #{96rpx};
  1380. }
  1381. .exchange-title text {
  1382. display: inline-block;
  1383. position: absolute;
  1384. top: 0;
  1385. left: 0;
  1386. right: 0;
  1387. width: auto;
  1388. height: #{96rpx};
  1389. line-height: #{96rpx};
  1390. }
  1391. .good-list {
  1392. padding-left: #{24rpx};
  1393. }
  1394. .good-item {
  1395. width: #{344rpx};
  1396. background-color: #fff;
  1397. font-size: 14px;
  1398. color: #353535;
  1399. margin: #{14rpx} #{14rpx} 0 0;
  1400. position: relative;
  1401. display: block;
  1402. border-radius: #{16rpx};
  1403. position: relative;
  1404. .out-dialog {
  1405. width: #{344rpx};
  1406. height: #{344rpx};
  1407. position: absolute;
  1408. top: 0;
  1409. left: 0;
  1410. background-color: rgba(0,0,0,.5);
  1411. image {
  1412. width: #{344rpx};
  1413. height: #{344rpx};
  1414. }
  1415. }
  1416. }
  1417. .good-item .goods-cover {
  1418. height: #{344rpx};
  1419. width: #{344rpx};
  1420. display: block;
  1421. border-top-left-radius: #{16rpx};
  1422. border-top-right-radius: #{16rpx};
  1423. }
  1424. .good-info {
  1425. padding: #{12rpx} #{24rpx} #{24rpx} #{24rpx};
  1426. background-color: white;
  1427. border-bottom-left-radius: #{16rpx};
  1428. border-bottom-right-radius: #{16rpx};
  1429. }
  1430. .good-name {
  1431. color: #353535;
  1432. font-size: #{28rpx};
  1433. height: #{72rpx};
  1434. }
  1435. .good-price {
  1436. font-size: #{30rpx};
  1437. margin: #{8rpx} 0;
  1438. }
  1439. .good-price image {
  1440. height: #{30rpx};
  1441. width: #{30rpx};
  1442. display: block;
  1443. margin-right: #{16rpx};
  1444. }
  1445. .good-exchange {
  1446. width: #{296rpx};
  1447. height: #{48rpx};
  1448. border-radius: #{24rpx};
  1449. color: white;
  1450. font-size: #{28rpx};
  1451. line-height: #{48rpx};
  1452. text-align: center;
  1453. }
  1454. .good-exchange::after {
  1455. border: 0;
  1456. }
  1457. .bg {
  1458. position: fixed;
  1459. top: 0;
  1460. left: 0;
  1461. height: 100%;
  1462. width: 100%;
  1463. z-index: 500;
  1464. padding-top: #{400rpx};
  1465. background-color: rgba(0, 0, 0, .3)
  1466. }
  1467. .dialog {
  1468. width: #{600rpx};
  1469. height: #{250rpx};
  1470. text-align: center;
  1471. background-color: #fff;
  1472. border-radius: #{16rpx};
  1473. padding-top: #{65rpx};
  1474. font-size: #{28rpx};
  1475. position: relative;
  1476. }
  1477. .dialog-btn {
  1478. position: absolute;
  1479. bottom: 0;
  1480. left: 0;
  1481. right: 0;
  1482. height: #{90rpx};
  1483. line-height: #{90rpx};
  1484. border-top: #{1rpx} solid #e2e2e2;
  1485. }
  1486. .line {
  1487. height: #{90rpx};
  1488. width: #{1rpx};
  1489. background-color: #e2e2e2;
  1490. }
  1491. .submit-btn,.close-btn {
  1492. width: 50%;
  1493. }
  1494. .submit-btn {
  1495. color: #ff4544;
  1496. }
  1497. .goods-other-info {
  1498. font-size: #{24rpx};
  1499. color: #999999;
  1500. margin-bottom: #{14rpx};
  1501. }
  1502. .goods-other-info>view:first-of-type {
  1503. text-decoration: line-through;
  1504. }
  1505. </style>