pay.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <!--pages/pay/pay.wxml-->
  3. <view>
  4. <view class="pay">
  5. <view class="payt">
  6. <image src="/static/pages/images/wcico.png" v-if="isSuccess=='true'"></image>
  7. <image src="/static/pages/images/sbico.png" v-else></image>
  8. <view v-if="isSuccess=='true'">支付成功</view>
  9. <block v-else>
  10. <view class="fail">支付失败,请重新支付</view>
  11. <view class="price">¥<text>{{money}}</text></view>
  12. </block>
  13. </view>
  14. <view class="btn">
  15. <block v-if="isSuccess=='true'">
  16. <block v-if="isRx=='1'">
  17. <navigator :url="'/prescription/Consultation/index?orderId=' + orderId" class="order"
  18. hover-class="none">去开处方</navigator>
  19. </block>
  20. <block v-else>
  21. <view v-if="vip=='true'||balance=='true'">
  22. <navigator url="/wallet/index/index" class="order" hover-class="none"
  23. v-if="balance=='true'">查看余额</navigator>
  24. <navigator url="/mine/vip/vip" class="order" hover-class="none" v-if="vip=='true'">会员中心
  25. </navigator>
  26. </view>
  27. <navigator url="/mine/order/order" open-type="redirect" class="order" hover-class="none" v-else>
  28. 查看订单</navigator>
  29. <!-- <navigator url="/pages/shop/shop" open-type="reLaunch" hover-class="none" class="back" wx:if="{{isSuccess}}">返回首页</navigator> -->
  30. <view
  31. @click="goHome()" class="back">返回首页
  32. </view>
  33. </block>
  34. </block>
  35. <!-- <view @tap="payOrder" class="back" v-else>重新支付</view> -->
  36. </view>
  37. </view>
  38. <view class="tip" v-if="isRx=='1'">您的订单中包含处方药,需要医生开处方后才能发货,请及时完成开处方流程!</view>
  39. <view class="cai pdlr20" v-if="likeList.length>0">
  40. <view class="cai-tit dflex">
  41. <image src="/static/pages/images/cai_bg1.png"></image>猜您喜欢<image src="/static/pages/images/cai_bg2.png">
  42. </image>
  43. </view>
  44. <view class="tabcon dflex">
  45. <block v-for="(item, index) in likeList" :key="index">
  46. <view class="li" @tap="toDetail" :data-id="item.id">
  47. <view class="jsdimgs" @tap="toDetail" :data-id="item.id">
  48. <image :src="item.pic + '?x-oss-process=style/w210'" mode="aspectFit" class="jsdpro">
  49. </image>
  50. <image src="/static/pages/images/jishida.png" v-if="item.isJs" class="jsdimg"></image>
  51. </view>
  52. <view class="jsdinfo">
  53. <view class="proname" @tap="toDetail" :data-id="item.id">{{item.title}}</view>
  54. <view class="operate dflex">
  55. <view class="price proprice">
  56. ¥<text>{{item.salePrice}}</text>
  57. <text class="vip"
  58. v-if="about.show_membership_price==1&&item.actualPrice < item.salePrice"><text
  59. class="sale">VIP</text><text
  60. class="members">{{item.actualPrice}}</text></text>
  61. <text class="vip"
  62. v-if="about.show_membership_price==1&&item.membersPrice<item.salePrice"><text
  63. class="sale">VIP</text><text
  64. class="members">{{item.membersPrice}}</text></text>
  65. <text class="del" v-if="about.show_membership_price!=1">
  66. ¥{{item.marketPrice}}
  67. </text>
  68. </view>
  69. <view class="add-cart">
  70. <view class="nums dflex" v-if="item.count > 0">
  71. <image src="/static/pages/images/jian.png"></image>
  72. <view class="num">{{item.count}}</view>
  73. <image src="/static/pages/images/jia1.png"></image>
  74. </view>
  75. <image src="/static/pages/images/jia.png" v-else>
  76. </image>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </block>
  82. </view>
  83. </view>
  84. </view>
  85. </template>
  86. <script>
  87. import h5util from "../../utils/h5util.js";
  88. const req = require("../../utils/request.js");
  89. const app = getApp();
  90. export default {
  91. data() {
  92. return {
  93. isSuccess: true,
  94. header: req.header,
  95. likeList: [],
  96. isLikeLoad: true,
  97. page: 1,
  98. config: ''
  99. };
  100. },
  101. components: {},
  102. props: {},
  103. onLoad(options) {
  104. this.config = JSON.parse(req.getStorage('configRes'));
  105. this.setData(options);
  106. this.getLikeList();
  107. // console.log(options);
  108. },
  109. methods: {
  110. goHome(){
  111. h5util.jumpIndex()
  112. // app.globalData.openHome();
  113. },
  114. payOrder() {
  115. let _ts = this;
  116. req.payOrder(this.id, success => {
  117. _ts.setData({
  118. isSuccess: success
  119. });
  120. });
  121. },
  122. getLikeList() {
  123. //Recommend
  124. if (!this.isLikeLoad) return false;
  125. this.isLikeLoad = false;
  126. let that = this;
  127. req.getRequest('/api/product/list', {
  128. page: that.page,
  129. limit: 10,
  130. attr: 'sell_well'
  131. }, res => {
  132. if (res && res.length >= 10) that.isLikeLoad = true;
  133. if (that.page > 1) res = that.likeList.concat(res);
  134. res = res.map(it => {
  135. if (it.deliverWay && JSON.parse(it.deliverWay).indexOf(3) != -1) it.isJs = true;
  136. return it;
  137. });
  138. that.setData({
  139. likeList: res
  140. });
  141. });
  142. },
  143. toDetail(e) {
  144. let id = e.currentTarget.dataset.id;
  145. let url = 'product/detail/detail?id=' + id
  146. app.globalData.redirectTab('product/detail/detail?id=' + id);
  147. },
  148. }
  149. };
  150. </script>
  151. <style>
  152. @import "./pay.css";
  153. </style>