index.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. <template>
  2. <view style="background-color: #f2f2f6;padding-bottom: 0.01rpx;">
  3. <view style="background-color: #fff;position: fixed;top: 0;width: 100%;z-index: 8;">
  4. <view
  5. style="background-color:#E75F37;padding: 24rpx 32rpx;display: flex;justify-content: space-between;align-items: center;">
  6. <u-search placeholder="请输入商品名" v-model="cname" @custom="custom" @search="custom" :showAction="false"
  7. bgColor="#fff"></u-search>
  8. </view>
  9. <u-tabs :list="list" :current="current" lineColor="#E75F37" @click="sectionChange"></u-tabs>
  10. </view>
  11. <view style="margin-top: 180rpx;">
  12. <view class="card" v-for="(item,index) in dataList" :key="index" @click="choice(item,index)">
  13. <view>
  14. <view
  15. style="font-size: 26rpx;color: #717171;margin-bottom: 28rpx;display: flex;justify-content: space-between;">
  16. <view class="">
  17. {{item.salesCompanyName}}
  18. </view>
  19. <view style="color: #E75F37;">
  20. {{item.xcxStatus=='录入'?'待付款':item.xcxStatus || ''}}
  21. </view>
  22. </view>
  23. <view>
  24. <view style="display: flex;" v-for="(ite,inde) in item.orderItemsList" :key="inde">
  25. <view style="display: flex;width: 100%;align-items: center;margin-bottom: 20rpx;">
  26. <image :src="ite.url" mode="scaleToFill"
  27. style="width:120rpx;height: 120rpx;border-radius: 10rpx;border: 2rpx solid #EEEEEE;margin-right: 27rpx;">
  28. </image>
  29. <view style="width:477rpx;">
  30. <view
  31. style="display: flex;justify-content: space-between;align-items: center;font-size: 26rpx;color: #4E4E4E;font-weight: 500;">
  32. <u--text color="#4E4E4E" size="26rpx" :lines="1"
  33. :text="ite.goodsName"></u--text>
  34. <view>
  35. ¥{{ite.price}}
  36. </view>
  37. </view>
  38. <view style="display: flex;justify-content:flex-end;margin-top: 20rpx;">
  39. <view style="font-size: 26rpx;color: #4D4D4D;">
  40. x{{ite.goodsNum}}
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. <!-- <view style="display: flex;justify-content: flex-end;">
  48. <view style="width: 136rpx;margin-right: 17rpx;">
  49. <u-button type="primary" text="取消订单" color="#E75F37" shape='circle' plain
  50. @click="deleteGoods(item.id)"></u-button>
  51. </view>
  52. <view style="width: 136rpx;">
  53. <u-button type="primary" text="去支付" color="#E75F37" shape='circle'
  54. @click="paySubmit(item,index,ind)"></u-button>
  55. </view>
  56. </view> -->
  57. <view style="width: 623rpx;height: 2rpx;background: #F1F1F1;margin: 48rpx 0 40rpx 0;">
  58. </view>
  59. <view style="font-size: 26rpx;color: #717171;">
  60. <view style="margin-bottom: 20rx;">
  61. 订单编号:<text style="color: #C4C4C4;">{{item.ordNo}}</text>
  62. </view>
  63. <view style="margin-bottom: 20rx;">
  64. 支付方式:<text
  65. style="color: #C4C4C4;">{{item.payType && item.payType.indexOf('01') != -1?'扫码支付':'微信支付'}}</text>
  66. </view>
  67. <view>
  68. 下单时间:<text style="color: #C4C4C4;">{{item.createTime}}</text>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. <u-empty v-if="page.total == 0" style="position: absolute;top: 45%;left: 50%;transform:translate(-50%,-50%)"
  75. mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png" />
  76. <u-loadmore v-if="page.total !== 0 && dataList.length != 0" :status="status" />
  77. </view>
  78. </template>
  79. <script>
  80. import {
  81. appStatusList,
  82. appStatusShareList
  83. } from '@/api/views/salesSlip/index.js'
  84. export default {
  85. data() {
  86. return {
  87. current: 0,
  88. cname: "",
  89. list: [{
  90. name: '全部',
  91. status: '',
  92. badge: {
  93. value: 0
  94. }
  95. }
  96. // , {
  97. // name: '未付款',
  98. // status: '未付款',
  99. // badge: {
  100. // value: 0
  101. // }
  102. // }
  103. , {
  104. name: '待发货',
  105. status: '待发货',
  106. badge: {
  107. value: 0
  108. }
  109. }, {
  110. name: '待收货',
  111. status: '待收货',
  112. badge: {
  113. value: 0
  114. }
  115. }, {
  116. name: '已收货',
  117. status: '已收货',
  118. badge: {
  119. value: 0
  120. }
  121. }, {
  122. name: '退款售后',
  123. status: '退款请核,退款中,已取消',
  124. badge: {
  125. value: 0
  126. }
  127. }
  128. ],
  129. dataList: [],
  130. search: {},
  131. page: {
  132. total: 0,
  133. size: 10,
  134. current: 1
  135. },
  136. status: 'loadmore',
  137. }
  138. },
  139. onLoad(onLoad) {
  140. for (let i in this.list) {
  141. if (onLoad.text == this.list[i].name) {
  142. this.current = i
  143. }
  144. }
  145. this.page = {
  146. total: 0,
  147. size: 10,
  148. current: 1
  149. }
  150. this.search = {
  151. xcxStatus: this.list[this.current].status
  152. }
  153. this.dataList = []
  154. this.onSearch()
  155. },
  156. onReachBottom() {
  157. this.status = 'loading'
  158. if (this.dataList.length < this.page.total) {
  159. this.page.current++
  160. this.onSearch()
  161. } else {
  162. this.status = 'nomore'
  163. }
  164. },
  165. methods: {
  166. sectionChange(item) {
  167. this.current = item.index;
  168. this.search = {
  169. xcxStatus: this.list[item.index].name == "全部" ? "" : this.list[item.index].status
  170. }
  171. this.page = {
  172. total: 0,
  173. size: 10,
  174. current: 1
  175. }
  176. this.dataList = []
  177. this.onSearch()
  178. },
  179. onSearch() {
  180. uni.showLoading({
  181. title: '加载中',
  182. mask: true
  183. });
  184. if (uni.getStorageSync('whether_openShare') == 1) {
  185. appStatusShareList({
  186. size: this.page.size,
  187. current: this.page.current,
  188. ...this.search
  189. }).then(res => {
  190. this.dataList = this.dataList.concat(res.data.records)
  191. this.page.total = res.data.total
  192. if (this.dataList.length == res.data.total) {
  193. this.status = 'nomore'
  194. }
  195. uni.hideLoading();
  196. }).catch(err => {
  197. uni.hideLoading();
  198. })
  199. } else {
  200. appStatusList({
  201. size: this.page.size,
  202. current: this.page.current,
  203. ...this.search
  204. }).then(res => {
  205. this.dataList = this.dataList.concat(res.data.records)
  206. this.page.total = res.data.total
  207. if (this.dataList.length == res.data.total) {
  208. this.status = 'nomore'
  209. }
  210. uni.hideLoading();
  211. }).catch(err => {
  212. uni.hideLoading();
  213. })
  214. }
  215. },
  216. //搜索
  217. custom() {
  218. this.page = {
  219. total: 0,
  220. size: 10,
  221. current: 1
  222. }
  223. this.search = {
  224. retrieval: this.cname
  225. }
  226. this.dataList = []
  227. this.onSearch()
  228. },
  229. choice(item, index) {
  230. uni.$u.route('/pages/views/salesSlip/orderDetails', {
  231. id: item.id
  232. });
  233. }
  234. }
  235. }
  236. </script>
  237. <style lang="scss" scoped>
  238. .contentBox {
  239. width: 96%;
  240. margin: 20rpx auto;
  241. background-color: #FFFFFF;
  242. border-radius: 20rpx;
  243. /* box-shadow: 0 5rpx 14rpx 0 rgba(101, 176, 249, 0.42); */
  244. padding-top: 15rpx;
  245. padding-bottom: 10rpx;
  246. }
  247. .textBox {
  248. padding: 0 15px;
  249. display: flex;
  250. justify-content: space-between;
  251. font-size: 24rpx;
  252. margin-bottom: 10rpx;
  253. align-items: flex-end;
  254. }
  255. .card {
  256. padding: 54rpx 63rpx;
  257. background-color: #fff;
  258. margin-bottom: 20rpx;
  259. ::v-deep .u-button {
  260. height: 60rpx;
  261. }
  262. }
  263. </style>