paySuccess.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. <template>
  2. <view class="content">
  3. <!-- 支付成功 -->
  4. <view class="pay-box">
  5. <!-- <text class="success-icon iconfont iconroundcheck"></text> -->
  6. <image src="../../static/img/success.png" class="success-icon"></image>
  7. <text class="tit">支付金额:¥{{money}}</text>
  8. <view class="btn-group flex">
  9. <navigator url="/pages/order/order?state=1" open-type="redirect" class="mix-btn">查看订单</navigator>
  10. <navigator url="/pages/index/index" open-type="switchTab" class="mix-btn hollow">返回首页</navigator>
  11. <navigator v-if="goodstype == 2" :url="'/pages/product/details?pink_id=' + (goodsDetail.pink_id || '')" open-type="redirect" class="mix-btn hollow">马上分享</navigator>
  12. </view>
  13. <view class="warn">安全提醒:平台及商家不会以订单异常系统升级为由要 求你点击任何网址链接进行退款操作</view>
  14. </view>
  15. <!-- 猜你喜欢 -->
  16. <!-- <view class="like-box">
  17. <view class="line"></view>
  18. <view class="like-tit">猜你喜欢</view>
  19. <view class="line"></view>
  20. </view> -->
  21. <!-- 商品内容 -->
  22. <scroll-view scroll-y class="cate-list" @scrolltolower="getProducts">
  23. <view class="guess-section">
  24. <view v-for="(item, index) in goodsList" :key="index" class="guess-item" @click="navToDetailPage(item)">
  25. <!-- <view class="guess-item"> -->
  26. <view class="image-wrapper">
  27. <image :src="item.image" mode="aspectFill"></image>
  28. <!-- <image src="../../static/img/img02.png" mode="aspectFill"></image> -->
  29. </view>
  30. <text class="title clamp margin-c-20">{{ item.store_name }}</text>
  31. <view class="cmy-hr"></view>
  32. <view class="price margin-c-20 flex">
  33. <view>
  34. <text class="font-size-sm ">¥</text>
  35. {{ item.price }}
  36. </view>
  37. <view class="font-size-sm">
  38. <text class="font-color-gray">{{ item.sales }}人购买</text>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <!-- <uni-load-more :status="loadingType"></uni-load-more> -->
  44. </scroll-view>
  45. </view>
  46. </template>
  47. <script>
  48. import { getProducts } from '@/api/product.js';
  49. import { orderDetail } from '@/api/order.js';
  50. export default {
  51. data() {
  52. return {
  53. money:0,
  54. goodsList: [],
  55. limit: 6, //每次加载数据条数
  56. page: 1, //当前页数
  57. loadingType: 'more', //加载更多状态
  58. goodsDetail: {},
  59. showpink: false ,//判断是否显示拼团
  60. goodstype: '', // 商品类型
  61. };
  62. },
  63. onLoad(op) {
  64. this.goodstype = op.goodstype;
  65. if (op.newGoods) {
  66. this.showpink = true;
  67. }
  68. if (op.orderid) {
  69. orderDetail({}, op.orderid).then(e => {
  70. this.goodsDetail = e.data;
  71. setTimeout(e => {
  72. if (op.newGoods) {
  73. uni.navigateTo({
  74. url: '/pages/product/details?pink_id=' + (e.data.pink_id || '')
  75. });
  76. }
  77. }, 1500);
  78. });
  79. }
  80. this.money = op.money;
  81. // this.getProducts();
  82. },
  83. //下拉刷新
  84. onPullDownRefresh() {
  85. // 重置当前页面
  86. this.page = 1;
  87. // 加载商品
  88. // this.getProducts('refresh');
  89. },
  90. methods: {
  91. // 加载商品
  92. async getProducts(type, loading) {
  93. let obj = this;
  94. //没有更多直接返回
  95. if (type !== 'refresh') {
  96. if (obj.loadingType === 'nomore') {
  97. return;
  98. } else {
  99. obj.loadingType = 'loading';
  100. }
  101. } else {
  102. obj.loadingType = 'more';
  103. }
  104. let data = {
  105. page: obj.page,
  106. limit: obj.limit,
  107. news: obj.newOrder,
  108. keyword: this.keyword,
  109. mer_id: this.shopId
  110. };
  111. getProducts(data).then(e => {
  112. if (type === 'refresh') {
  113. obj.goodsList = [];
  114. }
  115. obj.goodsList = obj.goodsList.concat(e.data);
  116. //判断是否还有下一页,有是more 没有是nomore
  117. if (obj.limit == e.data.length) {
  118. obj.page++;
  119. obj.loadingType = 'more';
  120. } else {
  121. obj.loadingType = 'nomore';
  122. }
  123. if (type === 'refresh') {
  124. if (loading == 1) {
  125. uni.hideLoading();
  126. } else {
  127. uni.stopPullDownRefresh();
  128. }
  129. }
  130. });
  131. },
  132. navToDetailPage(item) {
  133. //测试数据没有写id,用title代替
  134. let id = item.id;
  135. uni.navigateTo({
  136. url: '/pages/product/product?id=' + id
  137. });
  138. }
  139. }
  140. };
  141. </script>
  142. <style lang="scss">
  143. .pay-box {
  144. display: flex;
  145. flex-direction: column;
  146. justify-content: center;
  147. align-items: center;
  148. background: rgba(255, 255, 255, 1);
  149. .success-icon {
  150. font-size: 96rpx;
  151. color: #5dbc7c;
  152. margin-top: 40rpx;
  153. width: 96rpx;
  154. height: 96rpx;
  155. }
  156. .tit {
  157. font-size: 38rpx;
  158. color: #303133;
  159. height: 34px;
  160. font-family: PingFangSC;
  161. font-weight: 500;
  162. color: rgba(51, 51, 51, 1);
  163. line-height: 56px;
  164. &.price {
  165. font-size: 42rpx;
  166. }
  167. }
  168. .btn-group {
  169. padding-top: 40rpx;
  170. display: flex;
  171. width: 100%;
  172. padding-right: 40rpx;
  173. padding-left: 40rpx;
  174. justify-content: space-around;
  175. .mix-btn {
  176. width: 180rpx;
  177. height: 60rpx;
  178. background: rgba(255, 255, 255, 1);
  179. border: 1px solid rgba(204, 204, 204, 1);
  180. border-radius: 6rpx;
  181. margin-top: 30upx;
  182. display: flex;
  183. align-items: center;
  184. justify-content: center;
  185. font-size: $font-lg;
  186. color: #333333;
  187. &.hollow {
  188. background: #fff;
  189. color: #666666;
  190. }
  191. }
  192. }
  193. .warn {
  194. font-size: 28rpx;
  195. font-weight: 500;
  196. color: rgba(249, 174, 41, 1);
  197. line-height: 40rpx;
  198. padding: 40rpx;
  199. }
  200. }
  201. /* 猜你喜欢标题 */
  202. .like-box {
  203. display: flex;
  204. align-items: center;
  205. height: 77rpx;
  206. justify-content: center;
  207. .line {
  208. width: 46rpx;
  209. height: 2rpx;
  210. background: linear-gradient(to right, rgba(255, 255, 255, 1), rgba(153, 153, 153, 1));
  211. &:last-of-type {
  212. background: linear-gradient(to right, rgba(153, 153, 153, 1), rgba(255, 255, 255, 1));
  213. }
  214. }
  215. .like-tit {
  216. font-size: 28rpx;
  217. font-weight: 500;
  218. color: rgba(63, 69, 75, 1);
  219. line-height: 55rpx;
  220. margin: 0 14rpx;
  221. }
  222. }
  223. .guess-section {
  224. display: flex;
  225. flex-wrap: wrap;
  226. padding: 0 24rpx;
  227. .guess-item {
  228. overflow: hidden;
  229. display: flex;
  230. flex-direction: column;
  231. width: 48%;
  232. margin-bottom: 4%;
  233. border-radius: $border-radius-sm;
  234. background-color: white;
  235. box-shadow: $box-shadow;
  236. &:nth-child(2n + 1) {
  237. margin-right: 3%;
  238. }
  239. }
  240. .image-wrapper {
  241. width: 100%;
  242. height: 330rpx;
  243. border-radius: 3px;
  244. overflow: hidden;
  245. image {
  246. width: 100%;
  247. height: 100%;
  248. opacity: 1;
  249. }
  250. }
  251. .title {
  252. font-size: $font-base;
  253. color: $font-color-dark;
  254. font-weight: bold;
  255. line-height: 80rpx;
  256. overflow: hidden;
  257. text-overflow: ellipsis;
  258. }
  259. .price {
  260. font-size: $font-lg;
  261. /* color: $font-color-base; */
  262. font-weight: bold;
  263. line-height: 1;
  264. line-height: 80rpx;
  265. color: rgba(252, 65, 65, 1);
  266. }
  267. /* .icon {
  268. @extend %icon;
  269. } */
  270. .detail {
  271. line-height: 1;
  272. }
  273. .tip {
  274. color: white;
  275. background-color: $color-yellow;
  276. line-height: 1.5;
  277. font-size: $font-sm;
  278. padding-left: 20rpx;
  279. }
  280. }
  281. </style>