noPayOrder.vue 6.2 KB

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