noUpOrder.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <template>
  2. <view>
  3. <view class="tab">
  4. <u-tabs :list="tab" @click="click" :lineHeight="5"></u-tabs>
  5. </view>
  6. <view class="goodsList">
  7. <view class="item" v-for="(item, index) in list" :key="index">
  8. <view class="title">{{ item.buyUserName }}
  9. <view class="state" v-if="item.finishStatus == 1 && item.upStatus == 1">
  10. <text class="icon">&#xe830;</text>
  11. <text>未上架</text>
  12. </view>
  13. <view class="state" v-else-if="item.finishStatus == 1 && item.upStatus == 3">
  14. <text class="icon">&#xe830;</text>
  15. <text>已下架</text>
  16. </view>
  17. <view class="state" v-else-if="item.finishStatus == 1 && item.upStatus == 2 && item.resaleStatus == 0">
  18. <text class="icon">&#xe830;</text>
  19. <text>未转售</text>
  20. </view>
  21. <view class="state" v-else>
  22. <text class="icon" style="color: #13ce66">&#xe830;</text>
  23. <text>已完成</text>
  24. </view>
  25. </view>
  26. <view class="title">{{ item.phone }}</view>
  27. <view class="con">
  28. <view style="font-size: 16px;padding-top: 7px;color: #a0a2a6;">
  29. <text>订单 {{ item.tradeNo }}</text>
  30. </view>
  31. <view class="desc">
  32. <text>{{ item.goodsNames }} {{ item.totalWeight }}{{ item.goodsUnit }}</text>
  33. </view>
  34. <view class="price">¥ {{ item.totalPrice }}</view>
  35. </view>
  36. <view class="clear"></view>
  37. <view class="op">
  38. <view class="date">{{ item.createTime }}</view>
  39. <template v-if="item.phone">
  40. <!-- <view class="state" style="color: #3c9cff;" @click="callNumber(item.phone)">拨打电话</view> -->
  41. <a :href="'tel:'+item.phone" class="an down_btn">拨打电话</a>
  42. </template>
  43. </view>
  44. </view>
  45. <view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
  46. <u-empty v-if="!loadMore && list.length == 0"></u-empty>
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. import permision from "@/js_sdk/wa-permission/permission.js"
  52. export default {
  53. data() {
  54. return {
  55. tab: [{
  56. name: '全部',
  57. peopleConfirmStatus: '', //边民确认状态
  58. cooperEntrustStatus: '', //互助委托申报确认状态
  59. applyConfirmStatus: '', //进口申报确认状态
  60. finishStatus: 1, //订单完成状态
  61. upStatus: '', //订单上架状态(1=未上架,2=上架,3=已下架)
  62. resaleStatus: '', //订单转售状态
  63. Sxb010Status: '', //扣款回执状态
  64. },
  65. {
  66. name: '未上架',
  67. finishStatus: 1,
  68. upStatus: 1,
  69. },
  70. {
  71. name: '已下架',
  72. finishStatus: 1,
  73. upStatus: 3,
  74. },
  75. {
  76. name: '未转售',
  77. finishStatus: 1,
  78. upStatus: 2,
  79. resaleStatus: 0
  80. }
  81. ],
  82. param: {
  83. pageNo: 1,
  84. pageSize: 10,
  85. finishStatus: 1
  86. },
  87. list: [],
  88. loadMore: true,
  89. id: '',
  90. flag: '',
  91. };
  92. },
  93. onShow() {
  94. this.getData();
  95. },
  96. methods: {
  97. getData() {
  98. this.http.request({
  99. url: '/level-one-server/app/TbOrder/getPeopleOrderList',
  100. loading: 'false',
  101. data: this.param,
  102. success: res => {
  103. this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
  104. if (res.data.data) {
  105. this.list = res.data.data;
  106. }
  107. }
  108. });
  109. },
  110. // 点击tab切换
  111. click(e) {
  112. console.log(e);
  113. this.param.peopleConfirmStatus = e.peopleConfirmStatus;
  114. this.param.cooperEntrustStatus = e.cooperEntrustStatus;
  115. this.param.applyConfirmStatus = e.applyConfirmStatus;
  116. this.param.finishStatus = e.finishStatus;
  117. this.param.resaleStatus = e.resaleStatus;
  118. this.param.upStatus = e.upStatus;
  119. this.param.Sxb010Status = e.Sxb010Status;
  120. this.refresh();
  121. },
  122. // 刷新数据
  123. refresh() {
  124. this.loadMore = true;
  125. this.param.pageNo = 1;
  126. this.list = [];
  127. this.getData();
  128. },
  129. callNumber(phone) {
  130. permision.gotoAppPermissionSetting();
  131. uni.makePhoneCall({
  132. phoneNumber: phone,
  133. success: function(ress) {
  134. console.log("拨打电话成功!",JSON.stringify(ress))
  135. },
  136. fail: function() {
  137. console.log("拨打电话失败!")
  138. }
  139. })
  140. /* plus.android.requestPermissions(
  141. ["android.permission.CALL_PHONE"],
  142. function(resultObj) {
  143. var result = 0;
  144. for (var i = 0; i < resultObj.granted.length; i++) {
  145. var grantedPermission = resultObj.granted[i];
  146. console.log('已获取的权限:' + grantedPermission);
  147. result = 1
  148. }
  149. for (var i = 0; i < resultObj.deniedPresent.length; i++) {
  150. var deniedPresentPermission = resultObj.deniedPresent[i];
  151. console.log('拒绝本次申请的权限:' + deniedPresentPermission);
  152. result = 0
  153. }
  154. for (var i = 0; i < resultObj.deniedAlways.length; i++) {
  155. var deniedAlwaysPermission = resultObj.deniedAlways[i];
  156. console.log('永久拒绝申请的权限:' + deniedAlwaysPermission);
  157. result = -1
  158. }
  159. console.log(result);
  160. if(result == 1){
  161. uni.makePhoneCall({
  162. phoneNumber: "10086",//电话号码
  163. success(ress) {
  164. console.log("拨打电话成功",JSON.stringify(ress))
  165. },
  166. fail(err) {
  167. console.log("拨打电话失败",'err')
  168. }
  169. });
  170. }else{
  171. uni.showToast({
  172. title:"请开启拨号权限",
  173. icon:"error",
  174. })
  175. }
  176. },
  177. function(error) {
  178. console.log('申请权限错误:' + error.code + " = " + error.message);
  179. }
  180. ); */
  181. },
  182. },
  183. //下拉刷新
  184. onPullDownRefresh() {
  185. setTimeout(() => {
  186. this.refresh();
  187. uni.stopPullDownRefresh();
  188. }, 1000);
  189. },
  190. //上拉加载
  191. onReachBottom() {
  192. if (this.loadMore) {
  193. this.param.pageNo++;
  194. this.getData();
  195. }
  196. }
  197. };
  198. </script>
  199. <style lang="scss">
  200. page {
  201. background-color: $pg;
  202. }
  203. .down_btn {
  204. color: #f0f4f7;
  205. width: 66px;
  206. background-color: #3c9cff;
  207. text-align: center;
  208. border-radius: 10px;
  209. font-size: 14px;
  210. padding: 3px 5px;
  211. }
  212. .state {
  213. margin-right: -70px;
  214. }
  215. </style>