paySuccess.vue 6.8 KB

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