list.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <template>
  2. <view>
  3. <!--标题栏-->
  4. <bar-title bgColor='bg-white' @rightTap="barEditTap" title="商品订单">
  5. <block slot="content">商品订单</block>
  6. <!-- <block slot="right">
  7. <text v-if="goods_checked">完成</text>
  8. <text v-else>编辑</text>
  9. </block> -->
  10. </bar-title>
  11. <!--分类滑动列表-->
  12. <!-- <view class="zaiui-sort-grid-box">
  13. <scroll-view class="scroll-view" scroll-x>
  14. <block v-for="(item,index) in sort_grid_data" :key="index">
  15. <view :id="['sortGrid' + (index + 1 )]" class="scroll-item">
  16. <view class="cu-avatar radio" :style="[{backgroundImage:'url('+ item.img +')'}]"/>
  17. <view class="text-sm text">{{item.title}}</view>
  18. </view>
  19. </block>
  20. </scroll-view>
  21. </view> -->
  22. <!--tab列表-->
  23. <view class="bg-white zaiui-nav-tab-view">
  24. <scroll-view scroll-x class="nav z" scroll-with-animation :scroll-left="tab_scroll">
  25. <block v-for="(item,index) in nav_list" :key="index">
  26. <view class="cu-item" :class="index == tab_cur?'select':''" @tap="tabSelect" :data-index="index" :data-status="item.status">
  27. <view :class="index == tab_cur?'text-black':''">{{item.name}}</view>
  28. <view class="tab-dot bg-red"/>
  29. </view>
  30. </block>
  31. </scroll-view>
  32. </view>
  33. <!--订单列表-->
  34. <block v-if="order_list.length">
  35. <block v-for="(item,index) in order_list" :key="index">
  36. <view class="bg-white zaiui-order-tab-view" @tap="detailsTap" :data-item="item">
  37. <!--店铺名称-->
  38. <view class="shop-title-view">
  39. <view class="cu-avatar sm round" :style="[{backgroundImage:'url('+ item.pic +')'}]"/>
  40. <view class="text-black text-cut shop-name">{{item.order_num}}</view>
  41. <text class="text-right text-gray text-sm">{{item.status_name}}</text>
  42. </view>
  43. <!--商品列表-->
  44. <block v-for="(items,indexs) in item.detail" :key="indexs">
  45. <view class="goods-list-view" v-if="indexs < 2">
  46. <view class="cu-avatar lg radius" :style="[{backgroundImage:'url('+ items.pic +')'}]"/>
  47. <view class="goods-info-view">
  48. <view class="text-black text-cut name">{{items.name}}</view>
  49. <view class="text-gray text-sm text-cut introduce">{{items.sku_name}}</view>
  50. <view class="text-cut tag-view">
  51. <block v-for="(item_s,index_s) in items.tag" :key="index_s">
  52. <text class="cu-tag sm line-blue radius">{{item_s}}</text>
  53. </block>
  54. </view>
  55. <view class="text-red">{{items.cash}}</view>
  56. </view>
  57. </view>
  58. </block>
  59. <!--统计-->
  60. <view class="statistics-view">
  61. <view class="text-black text-sm text-right">
  62. <text>共{{item.num}}件</text>
  63. <text v-if="item.status >= 1">商品 实付:</text>
  64. <text v-if="item.status == 0">商品 应付:</text>
  65. <text class="text-lg">{{item.cash}}</text>
  66. </view>
  67. </view>
  68. <!--按钮-->
  69. <view class="zaiui-btn-view" v-if="item.type == 1">
  70. <button class="cu-btn line-black sm radius">联系卖家</button>
  71. <button class="cu-btn line-black sm radius" @tap="whereaboutsTap">查看钱款去向</button>
  72. <button class="cu-btn line-red sm radius" @tap="appraiseTap">查看评价</button>
  73. </view>
  74. <!--按钮-->
  75. <view class="zaiui-btn-view" v-if="item.type == 0">
  76. <button class="cu-btn line-black sm radius">联系卖家</button>
  77. </view>
  78. </view>
  79. </block>
  80. </block>
  81. <!--无数据-->
  82. <view class="bg-white zaiui-null-view" v-else>
  83. <view class="img-view">
  84. <view class="cu-avatar lg round" style="background-image:url('/static/zaiui/img/aa6.png')"/>
  85. </view>
  86. <view class="text-sm margin-top-sm">您还没有相关订单哦</view>
  87. </view>
  88. <!--到底了-->
  89. <!-- <view class="zaiui-foot-tip-view" v-if="tab_cur == 0">
  90. <view class="img-view">
  91. <view class="cu-avatar round" style="background-image:url('/static/zaiui/img/acn.png')"/>
  92. </view>
  93. <view class="text-gray">hi,到底啦~</view>
  94. </view> -->
  95. <!--小程序端显示-->
  96. <!-- #ifdef MP -->
  97. <!--编辑-->
  98. <view class="zaiui-add-btn-view-box" @tap="barEditTap">
  99. <button class="cu-btn cuIcon-check bg-red" v-if="goods_checked"></button>
  100. <button class="cu-btn cuIcon-write bg-red" v-else></button>
  101. </view>
  102. <!-- #endif -->
  103. </view>
  104. </template>
  105. <script>
  106. import barTitle from '@/components/zaiui-common/basics/bar-title';
  107. import _sort_grid from '@/static/zaiui/data/order_list.js'; //虚拟数据
  108. import _tool from '@/static/zaiui/util/tools.js';
  109. export default {
  110. components: {
  111. barTitle,
  112. },
  113. data() {
  114. return {
  115. sort_grid_data: [], nav_list: [], tab_cur: 0, tab_scroll: 0, order_list: [], goods_checked: false,
  116. status: ''
  117. }
  118. },
  119. onLoad(options) {
  120. this.sort_grid_data = _sort_grid.sortGridData();
  121. // this.order_list = _sort_grid.orderListData();
  122. // this.nav_list = _sort_grid.navListData();
  123. this.status = options.type;
  124. this.loadInfo()
  125. },
  126. onReady() {
  127. _tool.setBarColor(true);
  128. uni.pageScrollTo({
  129. scrollTop: 0,
  130. duration: 0
  131. });
  132. },
  133. methods: {
  134. loadInfo() {
  135. this.reqByuser({
  136. url: '?l=resource.getOrderList',
  137. data: {
  138. type: 3,
  139. status: this.status
  140. },
  141. success: res => {
  142. if(res.data.status == 1) {
  143. this.order_list = res.data.data.list;
  144. this.nav_list = [{name: '全部', status: ''}, ...res.data.data.order];
  145. }else {
  146. uni.showToast({
  147. icon: 'error',
  148. title: res.data.msg
  149. })
  150. }
  151. }
  152. })
  153. },
  154. tabSelect(e) {
  155. let index = e.currentTarget.dataset.index;
  156. this.tab_cur = index;
  157. this.tab_scroll = (index - 1) * 60;
  158. uni.pageScrollTo({
  159. scrollTop: 0,
  160. duration: 0
  161. });
  162. this.status = e.currentTarget.dataset.status;
  163. this.loadInfo()
  164. },
  165. barEditTap() {
  166. if (this.goods_checked) {
  167. this.goods_checked = false;
  168. } else {
  169. this.goods_checked = true;
  170. }
  171. },
  172. whereaboutsTap() {
  173. uni.navigateTo({
  174. url: "/pages/order/whereabouts"
  175. });
  176. },
  177. appraiseTap() {
  178. uni.navigateTo({
  179. url: "/pages/order/view_appraise"
  180. });
  181. },
  182. detailsTap(e) {
  183. uni.navigateTo({
  184. url: "/pages/order/details?id="+e.currentTarget.dataset.item.id
  185. });
  186. }
  187. }
  188. }
  189. </script>
  190. <style lang="scss">
  191. /* #ifdef APP-PLUS */
  192. @import "../../static/colorui/main.css";
  193. @import "../../static/colorui/icon.css";
  194. @import "../../static/zaiui/style/app.scss";
  195. /* #endif */
  196. @import "../../static/zaiui/style/order-list.scss";
  197. </style>