index.vue 53 KB

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