noUpOrder.vue 5.7 KB

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