changePriceOrderList.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. <template>
  2. <view>
  3. <view class="top-fixed">
  4. <!-- tab切换 -->
  5. <view class="pub-tab-box">
  6. <u-tabs :current="current" :list="listStatus" :scrollable="false" @change="listStatusChange"></u-tabs>
  7. </view>
  8. <view class="search-cont">
  9. <view class="inner">
  10. <image class="icon-search" src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/icon_search.png" mode=""></image>
  11. <input type="text" value="" placeholder="输入商品" confirm-type="搜索" @confirm="goSearch" placeholder-style="font-size:28rpx;color:#BBBBBB;font-family: PingFang SC;" />
  12. </view>
  13. </view>
  14. </view>
  15. <mescroll-body top="100px" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
  16. <view class="order-list">
  17. <view v-for="(item,index) in dataList" :key="index" class="item" >
  18. <view class="ordersn-box" @click="showDetail(item)">
  19. <view class="num">创建时间:{{item.createTime}}</view>
  20. <view class="status-box">
  21. <text class="text success" v-show="item.auditStatus==1">
  22. 审核中
  23. </text>
  24. <text class="text info" v-show="item.auditStatus==0">
  25. 待审核
  26. </text>
  27. <text class="text success" v-show="item.auditStatus==2">
  28. 已通过
  29. </text>
  30. <text class="text black" v-show="item.auditStatus==-1">
  31. 驳回
  32. </text>
  33. </view>
  34. </view>
  35. <view class="name-box">{{item.matchedProducts}}</view>
  36. <view class="amount-paid mt16" v-if="item.auditRemark&&item.auditStatus==-1">
  37. <text class="label">驳回原因:</text>
  38. <text style="font-size: 28rpx;">{{item.auditRemark||''}}</text>
  39. </view>
  40. <view class="amount-paid mt16">
  41. <text class="label">物流代收自定义金额:</text>
  42. <view class="price-box">
  43. <view class="unit">¥</view>
  44. <view class="num" >{{item.payAmount.toFixed(2)}}</view>
  45. </view>
  46. </view>
  47. <view class="bottom-box">
  48. <view class="amount-paid">
  49. <text class="label">支付金额:</text>
  50. <view class="price-box">
  51. <view class="unit">¥</view>
  52. <view class="num" >{{item.money.toFixed(2)}}</view>
  53. </view>
  54. </view>
  55. <view class="btn-box">
  56. <view class="btn pay" v-if="item.auditStatus==2" @click="handleDetail(item)">查看详情</view>
  57. <view class="btn cancel" v-if="item.auditStatus==0||item.auditStatus==-1" @click="handleDel(item)">删除</view>
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. </mescroll-body>
  63. </view>
  64. </template>
  65. <script>
  66. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  67. import { changeList,delList } from '../api/companyOrder.js'
  68. export default {
  69. mixins: [MescrollMixin],
  70. data() {
  71. return {
  72. listStatus: [
  73. {name:"审核中",value:"1"},
  74. {name:"待审核",value:"0"},
  75. {name:"已通过",value:"2"},
  76. {name:"驳回",value:"-1"}
  77. ],
  78. status: 1,
  79. current: 0,
  80. mescroll:null,
  81. downOption: {
  82. //下拉刷新
  83. use: true,
  84. auto: false // 不自动加载 (mixin已处理第一个tab触发downCallback)
  85. },
  86. // 上拉加载的配置
  87. upOption: {
  88. onScroll:true,
  89. use: true, // 是否启用上拉加载; 默认true
  90. page: {
  91. num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
  92. size: 10 // 每页数据的数量,默认10
  93. },
  94. noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
  95. empty: {
  96. icon:'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/empty_icon.png',
  97. tip: '暂无数据'
  98. }
  99. },
  100. // 列表数据
  101. dataList: [],
  102. searchKey: ''
  103. }
  104. },
  105. methods: {
  106. listStatusChange(e) {
  107. this.current = e.index
  108. this.status = e.value
  109. this.mescroll.resetUpScroll()
  110. },
  111. goSearch() {
  112. this.searchKey=e.detail.value;
  113. this.mescroll.resetUpScroll()
  114. },
  115. mescrollInit(mescroll) {
  116. this.mescroll = mescroll;
  117. },
  118. /*下拉刷新的回调 */
  119. downCallback(mescroll) {
  120. mescroll.resetUpScroll()
  121. },
  122. upCallback(page) {
  123. //联网加载数据
  124. var that = this;
  125. var data = {
  126. matchedProducts:this.searchKey,
  127. auditStatus:this.status,
  128. page: page.num,
  129. pageSize: page.size,
  130. token:uni.getStorageSync('CompanyUserToken')
  131. };
  132. changeList(data).then(res => {
  133. if(res.code==200){
  134. //设置列表数据
  135. if (page.num == 1) {
  136. that.dataList = res.data.list;
  137. } else {
  138. that.dataList = that.dataList.concat(res.data.list);
  139. }
  140. that.mescroll.endBySize(res.data.list.length, res.data.total);
  141. }else{
  142. uni.showToast({
  143. icon:'none',
  144. title: "请求失败",
  145. });
  146. that.dataList = null;
  147. that.mescroll.endErr();
  148. }
  149. });
  150. },
  151. handleDetail(item) {
  152. uni.navigateTo({
  153. url: '/pages_company/order/confirmCompanyOrder?source=audit&auditId='+item.id
  154. })
  155. },
  156. handleDel(item) {
  157. let that = this
  158. uni.showModal({
  159. title: '提示',
  160. content: '确定删除该申请吗?',
  161. success: function (res) {
  162. if (res.confirm) {
  163. delList(item.id).then(res=>{
  164. if(res.code == 200) {
  165. uni.showToast({
  166. icon:'none',
  167. title: '删除成功',
  168. });
  169. that.mescroll.resetUpScroll();
  170. } else {
  171. uni.showToast({
  172. icon:'none',
  173. title: res.msg,
  174. });
  175. }
  176. })
  177. } else if (res.cancel) {
  178. console.log('用户点击取消');
  179. }
  180. }
  181. });
  182. },
  183. }
  184. }
  185. </script>
  186. <style scoped lang="scss">
  187. .top-fixed{
  188. width: 100%;
  189. position: fixed;
  190. top: 0;
  191. left: 0;
  192. z-index: 10;
  193. }
  194. .pub-tab-box{
  195. box-sizing: border-box;
  196. width: 100%;
  197. padding: 0 40upx;
  198. background-color: #FFFFFF;
  199. }
  200. .search-cont{
  201. padding: 16upx 30upx;
  202. background-color: #FFFFFF;
  203. .inner{
  204. box-sizing: border-box;
  205. width: 100%;
  206. height: 72upx;
  207. background: #F7F7F7;
  208. border-radius: 36upx;
  209. display: flex;
  210. align-items: center;
  211. padding: 0 30upx;
  212. .icon-search{
  213. width: 28upx;
  214. height: 28upx;
  215. margin-right: 20upx;
  216. }
  217. input{
  218. height: 60upx;
  219. line-height: 60upx;
  220. flex: 1;
  221. }
  222. }
  223. }
  224. .order-list{
  225. padding: 20upx;
  226. .item{
  227. background: #FFFFFF;
  228. border-radius: 16upx;
  229. padding: 0 30upx;
  230. margin-bottom: 20upx;
  231. .ordersn-box{
  232. display: flex;
  233. align-items: center;
  234. justify-content: space-between;
  235. padding: 34upx 0 20upx;
  236. .num{
  237. font-size: 26upx;
  238. font-family: PingFang SC;
  239. font-weight: 500;
  240. color: #999999;
  241. line-height: 1;
  242. }
  243. .status-box{
  244. display: flex;
  245. align-items: center;
  246. .text{
  247. font-size: 28upx;
  248. font-family: PingFang SC;
  249. font-weight: 500;
  250. line-height: 1;
  251. &.success{
  252. color: #2583EB;
  253. }
  254. &.black{
  255. color: #111111;
  256. }
  257. &.info{
  258. color: #999999;
  259. }
  260. }
  261. }
  262. }
  263. }
  264. }
  265. .name-box {
  266. font-size: 32upx;
  267. font-family: PingFang SC;
  268. font-weight: 500;
  269. color: #111111;
  270. line-height: 40upx;
  271. }
  272. .amount-paid{
  273. display: flex;
  274. align-items: center;
  275. .label{
  276. font-size: 24upx;
  277. font-family: PingFang SC;
  278. font-weight: 500;
  279. color: #999999;
  280. line-height: 1;
  281. }
  282. .price-box{
  283. display: flex;
  284. align-items: flex-end;
  285. .unit{
  286. font-size: 24upx;
  287. font-family: PingFang SC;
  288. font-weight: 500;
  289. color: #FF6633;
  290. line-height: 1.2;
  291. margin-right: 4upx;
  292. }
  293. .num{
  294. font-size: 32upx;
  295. font-family: PingFang SC;
  296. font-weight: bold;
  297. color: #FF6633;
  298. line-height: 1;
  299. }
  300. }
  301. }
  302. .bottom-box{
  303. height: 110upx;
  304. display: flex;
  305. align-items: center;
  306. justify-content: space-between;
  307. .btn-box{
  308. box-sizing: border-box;
  309. display: flex;
  310. align-items: center;
  311. .btn{
  312. width: 155upx;
  313. height: 64upx;
  314. line-height: 64upx;
  315. font-size: 26upx;
  316. font-family: PingFang SC;
  317. font-weight: 500;
  318. text-align: center;
  319. border-radius: 32upx;
  320. margin-left: 15upx;
  321. &:first-child{
  322. margin-left: 0;
  323. }
  324. &.cancel{
  325. border: 1px solid #DDDDDD;
  326. color: #666666;
  327. }
  328. &.pay{
  329. background: #2583EB;
  330. color: #FFFFFF;
  331. }
  332. }
  333. }
  334. }
  335. </style>