noPayOrder.vue 6.1 KB

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