index.vue 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597
  1. <template>
  2. <app-layout>
  3. <view @click="toDetail">
  4. <view class='nav'>
  5. <image load-lazy='true' class='yuan' src='./../image/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='./../image/top.png'></image>
  16. </view>
  17. <view @click="toIndex" class='today-index'>
  18. <image load-lazy='true' src='./../image/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="./../image/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='./../image/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='./../image/none.png'></image>
  134. <view>暂无挑战赛哦</view>
  135. </view>
  136. </view>
  137. <view class='exchange-title'>
  138. <image load-lazy='true' src='./../image/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='./../image/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: './../image/friend.png'
  238. },
  239. {
  240. avatar: './../image/friend.png'
  241. },
  242. {
  243. avatar: './../image/friend.png'
  244. },
  245. {
  246. avatar: './../image/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: './../image/friend.png'
  400. },
  401. {
  402. avatar: './../image/friend.png'
  403. },
  404. {
  405. avatar: './../image/friend.png'
  406. },
  407. {
  408. avatar: './../image/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. that.template_remind = response.data.template_remind;
  429. that.template_activity = response.data.template_activity;
  430. that.activity_data = response.data.activity_data;
  431. that.ad_data = response.data.ad_data;
  432. that.banner_list = response.data.banner_list;
  433. that.user_data = response.data.user_data;
  434. that.invite_list = that.user_data.invite_list.concat(inviteList).slice(0, 4);
  435. that.first = true;
  436. } else {
  437. uni.showToast({
  438. title: response.msg,
  439. icon: 'none',
  440. duration: 1000
  441. });
  442. }
  443. }).catch(response => {
  444. that.$hideLoading();
  445. that.$event.on(that.$const.EVENT_USER_LOGIN).then(()=>{
  446. that.aliAuth(today);
  447. });
  448. });
  449. },
  450. fail: (res) => {
  451. uni.showModal({
  452. content: res.errMsg,
  453. showCancel: false,
  454. });
  455. }
  456. });
  457. },
  458. runData() {
  459. let that = this;
  460. let code, iv, encrypted_data;
  461. let inviteList = [{
  462. avatar: './../image/friend.png'
  463. },
  464. {
  465. avatar: './../image/friend.png'
  466. },
  467. {
  468. avatar: './../image/friend.png'
  469. },
  470. {
  471. avatar: './../image/friend.png'
  472. }
  473. ]
  474. uni.login({
  475. success(res) {
  476. if(that.user_id == 0 && that.userInfo) {
  477. that.user_id = that.userInfo.options.user_id;
  478. }
  479. code = res.code;
  480. // 获取iv和encryptedData
  481. uni.getWeRunData({
  482. success(res) {
  483. iv = res.iv;
  484. encrypted_data = res.encryptedData;
  485. that.$request({
  486. url: that.$api.step.index,
  487. data: {
  488. encrypted_data: encrypted_data,
  489. iv: iv,
  490. parent_id: that.user_id,
  491. code: code,
  492. page: 1
  493. },
  494. method: 'POST',
  495. }).then(response=>{
  496. that.$hideLoading();
  497. if (response.code == 0) {
  498. that.template_remind = response.data.template_remind;
  499. that.template_activity = response.data.template_activity;
  500. that.activity_data = response.data.activity_data;
  501. that.ad_data = response.data.ad_data;
  502. that.banner_list = response.data.banner_list;
  503. that.user_data = response.data.user_data;
  504. that.invite_list = that.user_data.invite_list.concat(inviteList).slice(0, 4);
  505. that.first = true;
  506. } else {
  507. uni.showToast({
  508. title: response.msg,
  509. icon: 'none',
  510. duration: 1000
  511. });
  512. }
  513. }).catch(response => {
  514. that.$hideLoading();
  515. that.$event.on(that.$const.EVENT_USER_LOGIN).then(()=>{
  516. that.runData();
  517. });
  518. });
  519. },
  520. fail(res) {
  521. if (res.errMsg == 'getWeRunData:fail cancel') {
  522. uni.showModal({
  523. content: '读取失败,请稍后再试',
  524. showCancel: false,
  525. });
  526. } else if (res.errMsg == 'getWeRunData: fail device not support') {
  527. uni.showModal({
  528. content: '请在微信中搜索"微信运动"公众号,并点击关注',
  529. showCancel: false,
  530. });
  531. } else {
  532. uni.showModal({
  533. content: res.errMsg,
  534. showCancel: false,
  535. });
  536. }
  537. }
  538. })
  539. }
  540. })
  541. },
  542. getGoods() {
  543. let that = this;
  544. that.$request({
  545. url: that.$api.step.goods,
  546. data: {
  547. page: that.page
  548. },
  549. }).then(response=>{
  550. if(response.code == 0) {
  551. that.goods = that.goods.concat(response.data.list);
  552. that.page++;
  553. }else {
  554. uni.showToast({
  555. title: response.msg,
  556. icon: 'none',
  557. duration: 1000
  558. });
  559. }
  560. }).catch(response => {
  561. that.$hideLoading();
  562. });
  563. },
  564. refresh() {
  565. this.$showLoading({
  566. type: 'global',
  567. text: '步数加载中...'
  568. });
  569. // #ifdef MP-WEIXIN
  570. this.runData();
  571. // #endif
  572. // #ifdef MP-ALIPAY
  573. var myDate = new Date();
  574. let year = myDate.getFullYear();
  575. let month = myDate.getMonth() + 1;
  576. if (month >= 1 && month <= 9) {
  577. month = "0" + month;
  578. }
  579. let now = myDate.getDate();
  580. let today = year + "-" + month + "-" + now;
  581. this.aliAuth(today);
  582. // #endif
  583. },
  584. openMsg() {
  585. if(this.user_data.is_remind == 0) {
  586. this.$subscribe(this.template_remind);
  587. }
  588. },
  589. toSwitch(e) {
  590. let checked = 0;
  591. if (e.detail.value) {
  592. checked = 1
  593. }
  594. let that = this;
  595. this.$request({
  596. url: this.$api.step.remind,
  597. data: {
  598. is_remind: checked
  599. },
  600. method: 'post',
  601. }).then(response => {
  602. if (response.code == 0) {
  603. this.user_data.is_remind = checked;
  604. }
  605. }).catch(response => {
  606. });
  607. },
  608. exchange() {
  609. let that = this;
  610. let convert_ratio = +that.setting.convert_ratio;
  611. let daily_real_num = +that.user_data.daily_real_num;
  612. let daily_num = +that.user_data.daily_num;
  613. let num = 0;
  614. if (convert_ratio > 0) {
  615. num = (daily_num / convert_ratio).toFixed(2);
  616. }
  617. if (daily_num < 1 || num < 0.01) {
  618. uni.showToast({
  619. title: '可兑换步数不足',
  620. icon: 'none',
  621. duration: 1000
  622. });
  623. } else {
  624. that.toExchange = true;
  625. that.exchangNum = num;
  626. that.$forceUpdate();
  627. }
  628. },
  629. subscribe() {
  630. if(this.loading) {
  631. return false;
  632. }
  633. this.loading = true;
  634. this.$subscribe(this.template_remind).then(res => {
  635. this.exchangeSubmit();
  636. }).catch(res => {
  637. this.exchangeSubmit();
  638. });
  639. },
  640. exchangeRequest(num, code, encrypted_data, iv) {
  641. let that = this;
  642. that.$request({
  643. url: that.$api.step.convert,
  644. data: {
  645. num: num,
  646. code: code,
  647. encrypted_data: encrypted_data,
  648. iv: iv,
  649. },
  650. method: 'post',
  651. }).then(response => {
  652. that.loading = false;
  653. uni.hideLoading();
  654. if (response.code == 0) {
  655. uni.showToast({
  656. title: "兑换成功",
  657. icon: 'success',
  658. duration: 1000
  659. });
  660. setTimeout(function(){
  661. // #ifdef MP-WEIXIN
  662. that.runData();
  663. // #endif
  664. // #ifdef MP-ALIPAY
  665. var myDate = new Date();
  666. let year = myDate.getFullYear();
  667. let month = myDate.getMonth() + 1;
  668. if (month >= 1 && month <= 9) {
  669. month = "0" + month;
  670. }
  671. let now = myDate.getDate();
  672. let today = year + "-" + month + "-" + now;
  673. that.aliAuth(today);
  674. // #endif
  675. },1000)
  676. } else {
  677. uni.showToast({
  678. title: response.msg,
  679. icon: 'none',
  680. duration: 1000
  681. });
  682. }
  683. }).catch(response => {
  684. that.loading = false;
  685. uni.hideLoading();
  686. });
  687. },
  688. exchangeSubmit() {
  689. let that = this;
  690. let num = this.user_data.daily_real_num;
  691. let code, iv, encrypted_data;
  692. that.toExchange = false;
  693. // #ifdef MP-ALIPAY
  694. var myDate = new Date();
  695. let year = myDate.getFullYear();
  696. let month = myDate.getMonth() + 1;
  697. if (month >= 1 && month <= 9) {
  698. month = "0" + month;
  699. }
  700. let now = myDate.getDate();
  701. let today = year + "-" + month + "-" + now;
  702. // #endif
  703. uni.showLoading({
  704. mask: true,
  705. title: '兑换中...'
  706. });
  707. uni.login({
  708. success(res) {
  709. code = res.code;
  710. // 获取iv和encryptedData
  711. // #ifndef MP-ALIPAY
  712. uni.getWeRunData({
  713. success(res) {
  714. iv = res.iv;
  715. encrypted_data = res.encryptedData;
  716. that.exchangeRequest(num, code, encrypted_data, iv);
  717. },
  718. fail(res) {
  719. that.loading = false;
  720. uni.hideLoading();
  721. uni.showModal({
  722. content: res.errMsg,
  723. showCancel: false,
  724. });
  725. }
  726. })
  727. // #endif
  728. // #ifdef MP-ALIPAY
  729. my.getRunData({
  730. countDate: today,
  731. success: (res) => {
  732. encrypted_data = res.response;
  733. that.exchangeRequest(num, code, encrypted_data, iv);
  734. },
  735. fail(res) {
  736. that.loading = false;
  737. uni.hideLoading();
  738. if (res.errMsg == 'getWeRunData:fail cancel') {
  739. uni.showModal({
  740. content: '读取失败,请稍后再试',
  741. showCancel: false,
  742. });
  743. } else if (res.errMsg == 'getWeRunData: fail device not support') {
  744. uni.showModal({
  745. content: '请在微信中搜索"微信运动"公众号,并点击关注',
  746. showCancel: false,
  747. });
  748. } else {
  749. uni.showModal({
  750. content: res.errMsg,
  751. showCancel: false,
  752. });
  753. }
  754. }
  755. })
  756. // #endif
  757. },
  758. fail(res) {
  759. that.loading = false;
  760. uni.hideLoading();
  761. uni.showModal({
  762. content: res.errMsg,
  763. showCancel: false,
  764. });
  765. }
  766. })
  767. },
  768. },
  769. onReachBottom() {
  770. this.getGoods();
  771. },
  772. // #ifdef MP-WEIXIN
  773. onShareTimeline() {
  774. return this.$shareTimeline({
  775. title: this.share_title ? this.share_title : this.$children[0].navigationBarTitle,
  776. query: {} // 此处填写页面的参数
  777. });
  778. },
  779. // #endif
  780. onLoad(options) { this.$commonLoad.onload(options);
  781. let that = this;
  782. // #ifdef MP-WEIXIN
  783. wx.showShareMenu({
  784. menus: ['shareAppMessage', 'shareTimeline']
  785. })
  786. // #endif
  787. that.$showLoading({
  788. type: 'global',
  789. text: '加载中...'
  790. });
  791. // #ifdef MP-BAIDU || MP-TOUTIAO
  792. uni.showModal({
  793. title: '提示',
  794. showCancel: false,
  795. content: '本平台暂不支持该插件',
  796. success: function (res) {
  797. uni.redirectTo({
  798. url: '/pages/index/index'
  799. });
  800. }
  801. });
  802. return false;
  803. // #endif
  804. this.$store.dispatch('user/info');
  805. if(options.user_id > 0) {
  806. that.user_id = options.user_id;
  807. }
  808. that.$request({
  809. url: that.$api.step.setting,
  810. }).then(response=>{
  811. // #ifdef MP-WEIXIN
  812. that.getAuth();
  813. // #endif
  814. // #ifdef MP-ALIPAY
  815. var myDate = new Date();
  816. let year = myDate.getFullYear();
  817. let month = myDate.getMonth() + 1;
  818. if (month >= 1 && month <= 9) {
  819. month = "0" + month;
  820. }
  821. let now = myDate.getDate();
  822. let today = year + "-" + month + "-" + now;
  823. that.aliAuth(today);
  824. that.getGoods();
  825. // #endif
  826. if(response.code == 0) {
  827. that.setting = response.data;
  828. that.share_title = response.data.share_title.toString();
  829. that.rules = response.data.rule;
  830. if(response.data.share_title.indexOf("\n") > -1) {
  831. let share_title = response.data.share_title.split("\n");
  832. let index = Math.floor(Math.random() * share_title.length);
  833. that.share_title = share_title[index]
  834. }
  835. }else {
  836. uni.showToast({
  837. title: response.msg,
  838. icon: 'none',
  839. duration: 1000
  840. });
  841. }
  842. }).catch(response => {
  843. that.$hideLoading();
  844. });
  845. },
  846. onShow() {
  847. let that = this;
  848. if (that.first == false) {
  849. return
  850. } else {
  851. // #ifdef MP-WEIXIN
  852. that.runData();
  853. // #endif
  854. // #ifdef MP-ALIPAY
  855. var myDate = new Date();
  856. let year = myDate.getFullYear();
  857. let month = myDate.getMonth() + 1;
  858. if (month >= 1 && month <= 9) {
  859. month = "0" + month;
  860. }
  861. let now = myDate.getDate();
  862. let today = year + "-" + month + "-" + now;
  863. that.aliAuth(today);
  864. // #endif
  865. }
  866. },
  867. // #ifdef MP
  868. onShareAppMessage() {
  869. return this.$shareAppMessage({
  870. title: this.share_title ? this.share_title : this.$children[0].navigationBarTitle,
  871. imageUrl: this.setting.share_pic ? this.setting.share_pic : '',
  872. path: "/plugins/step/index/index",
  873. params: {
  874. user_id: this.userInfo.options.user_id
  875. }
  876. });
  877. }
  878. // #endif
  879. }
  880. </script>
  881. <style scoped lang="scss">
  882. .share-qr-code-poster {
  883. width: #{750rpx};
  884. height: 100%;
  885. position: fixed;
  886. z-index: 1501;
  887. left: 0;
  888. top: 0;
  889. background-color: rgba(153, 153, 153, 0.5);
  890. .loading {
  891. width: #{220rpx};
  892. height: #{220rpx};
  893. }
  894. .app-icons {
  895. height: #{290rpx};
  896. .app-text {
  897. font-size: #{26rpx};
  898. color: #353535;
  899. }
  900. > view {
  901. width: 50%;
  902. height: 100%;
  903. .app-icon {
  904. width: #{120rpx};
  905. height: #{120rpx};
  906. background-size: cover;
  907. background-repeat: no-repeat;
  908. background-color: white;
  909. border-radius: 50%;
  910. margin-top: #{60rpx};
  911. margin-bottom: #{24rpx};
  912. }
  913. .app-share {
  914. background-image: url('../../../static/image/icon/share.png');
  915. }
  916. .app-code {
  917. background-image: url('../../../static/image/icon/code.png');
  918. }
  919. .text {
  920. font-size: #{26rpx};
  921. color: #353535;
  922. }
  923. }
  924. }
  925. .app-bottom {
  926. width: 100%;
  927. position: fixed;
  928. bottom: 0;
  929. left: 0;
  930. background-color: #f2f2f2;
  931. .app-icons {
  932. width: 100%;
  933. height: #{290rpx};
  934. }
  935. .app-button {
  936. width: 100%;
  937. height: #{100rpx};
  938. /deep/ button {
  939. border-radius: 0;
  940. border: none;
  941. }
  942. }
  943. }
  944. .app-center {
  945. width: calc(100% - #{80rpx});
  946. padding-top: #{100rpx};
  947. padding-bottom: #{77rpx};
  948. border-radius: #{8rpx};
  949. background-color: white;
  950. position: absolute;
  951. top: 50%;
  952. left: 50%;
  953. transform: translate(-50%, -50%);
  954. .app-close {
  955. width: #{30rpx};
  956. height: #{30rpx};
  957. background-size: cover;
  958. background-repeat: no-repeat;
  959. background-image: url("../../../static/image/icon/close.png");
  960. position: absolute;
  961. top: #{28rpx};
  962. right: #{24rpx};
  963. }
  964. .app-image-iframe {
  965. width: #{440rpx};
  966. height: #{783rpx};
  967. position: relative;
  968. box-shadow: #{2rpx} #{2rpx} #{10rpx} #d9d9d9;
  969. .text {
  970. text-align: center;
  971. color: #888;
  972. }
  973. }
  974. .app-button {
  975. width: #{500rpx};
  976. height: #{80rpx};
  977. margin-top: #{38rpx};
  978. margin-bottom: #{24rpx};
  979. }
  980. .app-text {
  981. font-size: #{24rpx};
  982. color: #999999;
  983. }
  984. }
  985. }
  986. .app-bottom {
  987. width: 100%;
  988. position: fixed;
  989. bottom: 0;
  990. left: 0;
  991. background-color: #f2f2f2;
  992. .app-icons {
  993. width: 100%;
  994. height: #{290rpx};
  995. }
  996. .app-button {
  997. width: 100%;
  998. height: #{100rpx};
  999. /deep/ button {
  1000. border-radius: 0;
  1001. border: none;
  1002. }
  1003. }
  1004. }
  1005. .nav {
  1006. height: #{90rpx};
  1007. line-height: #{90rpx};
  1008. background-color: #fff;
  1009. color: #353535;
  1010. padding: 0 #{30rpx};
  1011. font-size: #{28rpx};
  1012. }
  1013. .nav .yuan {
  1014. margin-top: #{28rpx};
  1015. height: #{34rpx};
  1016. width: #{34rpx};
  1017. display: block;
  1018. float: left;
  1019. margin-right: #{10rpx};
  1020. }
  1021. .nav .to-log {
  1022. margin-top: #{34rpx};
  1023. float: right;
  1024. height: #{22rpx};
  1025. width: #{12rpx};
  1026. display: block;
  1027. }
  1028. .rule {
  1029. position: absolute;
  1030. right: 0;
  1031. top: #{40rpx};
  1032. color: white;
  1033. font-size: #{24rpx};
  1034. height: #{48rpx};
  1035. width: #{90rpx};
  1036. line-height: #{48rpx};
  1037. border-top-left-radius: #{24rpx};
  1038. border-bottom-left-radius: #{24rpx};
  1039. background-color: rgba(0, 0, 0, 0.2);
  1040. }
  1041. .today-top {
  1042. height: #{74rpx};
  1043. width: #{74rpx};
  1044. position: absolute;
  1045. top: #{40rpx};
  1046. left: #{24rpx};
  1047. }
  1048. .today-top image {
  1049. height: #{74rpx};
  1050. width: #{74rpx};
  1051. }
  1052. .today-index {
  1053. height: #{74rpx};
  1054. width: #{74rpx};
  1055. position: absolute;
  1056. top: #{144rpx};
  1057. left: #{24rpx};
  1058. }
  1059. .today-index image {
  1060. height: #{74rpx};
  1061. width: #{74rpx};
  1062. }
  1063. .today-step {
  1064. width: 100%;
  1065. height: #{720rpx};
  1066. position: relative;
  1067. text-align: center;
  1068. }
  1069. .today-step .step-bg {
  1070. width: 100%;
  1071. height: #{720rpx};
  1072. }
  1073. .step-btn {
  1074. position: absolute;
  1075. top: #{90rpx};
  1076. left: 0;
  1077. right: 0;
  1078. margin: 0 auto;
  1079. font-size: #{24rpx};
  1080. color: #353535;
  1081. height: #{294rpx};
  1082. width: #{280rpx};
  1083. text-align: center;
  1084. padding: #{48rpx} 0 #{35rpx};
  1085. }
  1086. .step-btn:active {
  1087. border-radius: #{140rpx};
  1088. background-color: rgba(0, 0, 0, 0.5);
  1089. }
  1090. .step-num {
  1091. font-family: DIN;
  1092. font-size: #{64rpx};
  1093. margin: #{8rpx} 0 #{4rpx};
  1094. }
  1095. .step-tip {
  1096. font-size: #{20rpx};
  1097. color: #999;
  1098. margin-top: #{8rpx};
  1099. }
  1100. .get-now {
  1101. position: absolute;
  1102. top: #{400rpx};
  1103. left: 0;
  1104. right: 0;
  1105. font-size: #{26rpx};
  1106. color: #666;
  1107. }
  1108. .get-now image {
  1109. height: #{24rpx};
  1110. width: #{24rpx};
  1111. margin-right: #{10rpx};
  1112. }
  1113. .invite {
  1114. background: linear-gradient(to right, #ff9d1e, #ffb81e);
  1115. height: #{80rpx};
  1116. border-radius: #{40rpx};
  1117. box-shadow: 0 0 #{20rpx} #ffb71e;
  1118. text-shadow: 0 0 #{6rpx} #ffb81e;
  1119. line-height: #{80rpx};
  1120. color: white;
  1121. width: #{500rpx};
  1122. font-size: #{30rpx};
  1123. }
  1124. .invite-btn {
  1125. position: absolute;
  1126. top: #{452rpx};
  1127. left: 0;
  1128. right: 0;
  1129. margin: 0 auto;
  1130. width: #{500rpx};
  1131. }
  1132. .friend {
  1133. position: relative;
  1134. z-index: 10;
  1135. background-color: #fff;
  1136. margin: #{-150rpx} #{24rpx} 0;
  1137. padding: #{32rpx} #{24rpx};
  1138. padding-left: 0;
  1139. text-align: center;
  1140. font-size: #{24rpx};
  1141. color: #666;
  1142. }
  1143. .friend-left {
  1144. padding: #{12rpx} 0;
  1145. font-weight: bold;
  1146. width: #{108rpx};
  1147. height: #{80rpx};
  1148. text-align: center;
  1149. font-size: #{24rpx};
  1150. background-color: #ffebd2;
  1151. color: #ff9d1e;
  1152. border-top-right-radius: #{40rpx};
  1153. border-bottom-right-radius: #{40rpx};
  1154. float: left;
  1155. margin-right: #{24rpx};
  1156. }
  1157. .friend-list image {
  1158. height: #{80rpx};
  1159. width: #{80rpx};
  1160. border-radius: 50%;
  1161. margin: 0 #{10rpx};
  1162. }
  1163. .look-more {
  1164. padding-top: #{10rpx};
  1165. margin-top: #{4rpx};
  1166. float: right;
  1167. height: #{72rpx};
  1168. width: #{120rpx};
  1169. background-color: #f2f2f2;
  1170. color: #999;
  1171. font-size: #{22rpx};
  1172. border-radius: #{36rpx};
  1173. position: relative;
  1174. }
  1175. .look-more image {
  1176. height: #{20rpx};
  1177. width: #{10rpx};
  1178. position: absolute;
  1179. right: #{13rpx};
  1180. top: #{26rpx};
  1181. }
  1182. .everyday {
  1183. margin: #{20rpx} 0;
  1184. background-color: #fff;
  1185. padding: #{24rpx};
  1186. font-size: #{24rpx};
  1187. color: #999;
  1188. position: relative;
  1189. }
  1190. .everyday-title {
  1191. font-size: #{28rpx};
  1192. color: #353535;
  1193. }
  1194. .switch {
  1195. position: absolute !important;
  1196. right: #{24rpx};
  1197. top: #{36rpx};
  1198. }
  1199. .ad {
  1200. height: #{190rpx};
  1201. width: 100%;
  1202. margin-top: #{20rpx};
  1203. margin-bottom: #{20rpx};
  1204. }
  1205. .ad form {
  1206. width: 100%;
  1207. height: #{190rpx};
  1208. }
  1209. .ad image {
  1210. width: 100%;
  1211. height: #{190rpx};
  1212. }
  1213. .banner {
  1214. margin-bottom: #{20rpx};
  1215. height: #{190rpx};
  1216. }
  1217. .banner swiper {
  1218. height: #{190rpx};
  1219. }
  1220. .banner image {
  1221. height: #{190rpx};
  1222. width: 100%;
  1223. }
  1224. .dare {
  1225. padding: #{40rpx} 0 #{40rpx} #{32rpx};
  1226. margin: 0 #{24rpx};
  1227. background-color: white;
  1228. border-radius: #{16rpx};
  1229. }
  1230. .dare-banner {
  1231. color: #666;
  1232. font-size: #{24rpx};
  1233. height: #{40rpx};
  1234. line-height: #{40rpx};
  1235. margin-bottom: #{80rpx};
  1236. }
  1237. .dare-right {
  1238. float: right;
  1239. height: #{40rpx};
  1240. line-height: #{40rpx};
  1241. margin-right: #{32rpx};
  1242. color: #666;
  1243. }
  1244. .no-dare {
  1245. margin: #{54rpx} auto 0;
  1246. width: #{300rpx};
  1247. font-size: #{30rpx};
  1248. color: #999;
  1249. text-align: center;
  1250. background-color: white;
  1251. }
  1252. .join-over {
  1253. height: #{56rpx};
  1254. width: #{280rpx};
  1255. border-radius: #{28rpx};
  1256. background-color: #fff;
  1257. color: #ff9d1e;
  1258. border: 1px solid #ff9d1e;
  1259. font-size: #{26rpx};
  1260. line-height: #{56rpx};
  1261. margin: #{18rpx} 0 #{20rpx};
  1262. }
  1263. .submit-over {
  1264. height: #{56rpx};
  1265. width: #{210rpx};
  1266. border-radius: #{28rpx};
  1267. background-color: #fff;
  1268. color: #ff9d1e;
  1269. border: 1px solid #ff9d1e;
  1270. font-size: #{26rpx};
  1271. line-height: #{56rpx};
  1272. margin: #{18rpx} 0 #{20rpx};
  1273. }
  1274. .no-dare image {
  1275. height: #{300rpx};
  1276. width: #{300rpx};
  1277. margin-bottom: #{40rpx};
  1278. }
  1279. .dare-info {
  1280. color: #999;
  1281. font-size: #{30rpx};
  1282. margin-top: #{-4rpx};
  1283. }
  1284. .info-num {
  1285. margin: #{5rpx} 0 #{26rpx};
  1286. font-size: #{44rpx};
  1287. color: #ff9d1e;
  1288. }
  1289. .dare-date {
  1290. float: left;
  1291. width: auto;
  1292. }
  1293. .dare-title {
  1294. font-size: #{34rpx};
  1295. color: #353535;
  1296. padding: 0 #{13rpx};
  1297. border-left: #{6rpx} solid #ff9d1e;
  1298. float: left;
  1299. }
  1300. .dare-banner image {
  1301. height: #{20rpx};
  1302. width: #{10rpx};
  1303. margin-left: #{12rpx};
  1304. }
  1305. .height {
  1306. height: #{20rpx};
  1307. }
  1308. .start {
  1309. color: #666;
  1310. font-size: #{24rpx};
  1311. margin-top: #{30rpx};
  1312. margin-bottom: #{30rpx};
  1313. }
  1314. .dare-item {
  1315. height: #{250rpx};
  1316. background-color: white;
  1317. }
  1318. .dare-item .item-img {
  1319. margin: #{-28rpx} #{64rpx} 0 0;
  1320. height: #{250rpx};
  1321. width: #{250rpx};
  1322. float: left;
  1323. }
  1324. .dare-item .item-img image {
  1325. width: #{250rpx};
  1326. height: #{250rpx};
  1327. }
  1328. .dare-item .item {
  1329. color: #666;
  1330. height: #{250rpx};
  1331. float: left;
  1332. width: 52.5%;
  1333. }
  1334. .target-step {
  1335. color: #353535;
  1336. height: #{56rpx};
  1337. line-height: #{28rpx};
  1338. font-size: #{30rpx};
  1339. margin-bottom: #{18rpx};
  1340. }
  1341. .target-step text {
  1342. font-size: #{46rpx};
  1343. color: #ff4544;
  1344. font-family: 'DIN';
  1345. }
  1346. .dare-gold {
  1347. margin-top: #{-5rpx};
  1348. margin-bottom: #{8rpx};
  1349. font-size: #{26rpx};
  1350. }
  1351. .dare-gold text {
  1352. color: #ff9d1e;
  1353. }
  1354. .join {
  1355. height: #{56rpx};
  1356. width: #{200rpx};
  1357. border-radius: #{28rpx};
  1358. background-color: #ff9d1e;
  1359. color: #fff;
  1360. font-size: #{26rpx};
  1361. line-height: #{56rpx};
  1362. margin: #{18rpx} 0 #{20rpx};
  1363. }
  1364. .join::after {
  1365. border: 0;
  1366. }
  1367. .exchange-title {
  1368. font-size: #{30rpx};
  1369. color: #353535;
  1370. margin: #{20rpx} auto #{10rpx};
  1371. text-align: center;
  1372. height: #{96rpx};
  1373. background-color: white;
  1374. position: relative;
  1375. }
  1376. .exchange-title image {
  1377. width: #{320rpx};
  1378. height: #{96rpx};
  1379. }
  1380. .exchange-title text {
  1381. display: inline-block;
  1382. position: absolute;
  1383. top: 0;
  1384. left: 0;
  1385. right: 0;
  1386. width: auto;
  1387. height: #{96rpx};
  1388. line-height: #{96rpx};
  1389. }
  1390. .good-list {
  1391. padding-left: #{24rpx};
  1392. }
  1393. .good-item {
  1394. width: #{344rpx};
  1395. background-color: #fff;
  1396. font-size: 14px;
  1397. color: #353535;
  1398. margin: #{14rpx} #{14rpx} 0 0;
  1399. position: relative;
  1400. display: block;
  1401. border-radius: #{16rpx};
  1402. position: relative;
  1403. .out-dialog {
  1404. width: #{344rpx};
  1405. height: #{344rpx};
  1406. position: absolute;
  1407. top: 0;
  1408. left: 0;
  1409. background-color: rgba(0,0,0,.5);
  1410. image {
  1411. width: #{344rpx};
  1412. height: #{344rpx};
  1413. }
  1414. }
  1415. }
  1416. .good-item .goods-cover {
  1417. height: #{344rpx};
  1418. width: #{344rpx};
  1419. display: block;
  1420. border-top-left-radius: #{16rpx};
  1421. border-top-right-radius: #{16rpx};
  1422. }
  1423. .good-info {
  1424. padding: #{12rpx} #{24rpx} #{24rpx} #{24rpx};
  1425. background-color: white;
  1426. border-bottom-left-radius: #{16rpx};
  1427. border-bottom-right-radius: #{16rpx};
  1428. }
  1429. .good-name {
  1430. color: #353535;
  1431. font-size: #{28rpx};
  1432. height: #{72rpx};
  1433. }
  1434. .good-price {
  1435. font-size: #{30rpx};
  1436. margin: #{8rpx} 0;
  1437. }
  1438. .good-price image {
  1439. height: #{30rpx};
  1440. width: #{30rpx};
  1441. display: block;
  1442. margin-right: #{16rpx};
  1443. }
  1444. .good-exchange {
  1445. width: #{296rpx};
  1446. height: #{48rpx};
  1447. border-radius: #{24rpx};
  1448. color: white;
  1449. font-size: #{28rpx};
  1450. line-height: #{48rpx};
  1451. text-align: center;
  1452. }
  1453. .good-exchange::after {
  1454. border: 0;
  1455. }
  1456. .bg {
  1457. position: fixed;
  1458. top: 0;
  1459. left: 0;
  1460. height: 100%;
  1461. width: 100%;
  1462. z-index: 500;
  1463. padding-top: #{400rpx};
  1464. background-color: rgba(0, 0, 0, .3)
  1465. }
  1466. .dialog {
  1467. width: #{600rpx};
  1468. height: #{250rpx};
  1469. text-align: center;
  1470. background-color: #fff;
  1471. border-radius: #{16rpx};
  1472. padding-top: #{65rpx};
  1473. font-size: #{28rpx};
  1474. position: relative;
  1475. }
  1476. .dialog-btn {
  1477. position: absolute;
  1478. bottom: 0;
  1479. left: 0;
  1480. right: 0;
  1481. height: #{90rpx};
  1482. line-height: #{90rpx};
  1483. border-top: #{1rpx} solid #e2e2e2;
  1484. }
  1485. .line {
  1486. height: #{90rpx};
  1487. width: #{1rpx};
  1488. background-color: #e2e2e2;
  1489. }
  1490. .submit-btn,.close-btn {
  1491. width: 50%;
  1492. }
  1493. .submit-btn {
  1494. color: #ff4544;
  1495. }
  1496. .goods-other-info {
  1497. font-size: #{24rpx};
  1498. color: #999999;
  1499. margin-bottom: #{14rpx};
  1500. }
  1501. .goods-other-info>view:first-of-type {
  1502. text-decoration: line-through;
  1503. }
  1504. </style>