环卫车小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

142 lines
3.7 KiB

4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
3 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
3 months ago
4 months ago
4 months ago
4 months ago
3 months ago
4 months ago
3 months ago
4 months ago
3 months ago
4 months ago
3 months ago
3 months ago
3 months ago
3 months ago
4 months ago
4 months ago
  1. <template>
  2. <view>
  3. <u-sticky bgColor="#ffffff">
  4. <u-tabs :list="navList" :current="current" lineColor="#669A32" :activeStyle="{
  5. color: '#669A32',
  6. transform: 'scale(1.05)'
  7. }" :scrollable="true" itemStyle="padding-left: 20rpx; padding-right: 20rpx;font-size:22rpx; height: 80rpx;"
  8. @click="tabClick"></u-tabs>
  9. </u-sticky>
  10. <view class="se-p-40">
  11. <view v-if="list.length>0">
  12. <view class="se-px-40 se-mb-30 se-py-30 se-bgc-white se-br-40 se-bs-b" v-for="(items,indexs) in list"
  13. :key="indexs">
  14. <view class="se-flex se-flex-h-sb se-fw-6 se-fs-32 se-pb-20">
  15. <view class="se-flex">
  16. <text>{{items.carrentGoods.goodsName}}</text>
  17. </view>
  18. <view class="se-c-green se-fw-4">
  19. 已预约
  20. </view>
  21. </view>
  22. <view class="se-flex">
  23. <view class="se-w-160 se-h-160">
  24. <image class="se-w-160 se-h-160 se-bgc-f5 se-br-10" :src="items.carrentGoods.images[0]" mode=""></image>
  25. </view>
  26. <view class="se-ml-20 se-flex se-flex-v-sa se-flex-ai-fs">
  27. <view class="se-fw-6 se-c-black se-fs-30 se-display-ib">客户名称{{items.name}}</view>
  28. <view class="se-fs-24 se-c-text-third se-display-ib">电话{{items.phone}}</view>
  29. <view class="se-fs-24 se-c-text-third se-display-ib">地址{{items.area}}</view>
  30. </view>
  31. </view>
  32. <view class="se-flex se-flex-h-sb se-w-p-100 se-pt-20">
  33. <view class="se-fs-24 se-display-ib"></view>
  34. <view @click="onCustomerService(items.phone)"
  35. class="se-display-ib se-px-20 se-br-40 se-flex-h-c se-h-50 se-lh-50 se-bgc-green se-ta-c se-fs-24 se-fs-24 se-c-white se-b">
  36. <text>电话联系</text>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. <view v-else>
  42. <u-empty mode="list" ></u-empty>
  43. </view>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. import { queryOrderList,queryCategoryList } from "@/common/api.js"
  49. export default{
  50. data(){
  51. return{
  52. navList:[],
  53. current:0,
  54. typeId:null,
  55. pageNo:1,
  56. pageSize:10,
  57. list:[]
  58. }
  59. },
  60. onLoad(options) {
  61. this.onPageList()
  62. this.onQueryTypeList()
  63. },
  64. onPullDownRefresh() {
  65. let that = this
  66. that.pageNo = 1
  67. that.list = []
  68. that.onPageList()
  69. },
  70. onReachBottom() {
  71. let that = this
  72. that.pageNo = that.pageNo + 1
  73. that.onPageList()
  74. },
  75. methods:{
  76. onQueryTypeList(){
  77. queryCategoryList({}).then(response=>{
  78. console.info("queryCategoryList",response)
  79. let arr=[
  80. {
  81. name:"全部",
  82. id:null,
  83. }
  84. ];
  85. this.navList = arr.concat(response.result)
  86. }).catch(error=>{
  87. })
  88. },
  89. tabClick(event){
  90. let that = this
  91. that.pageNo = 1
  92. that.typeId = event.id;
  93. that.list = []
  94. that.onPageList()
  95. },
  96. onPageList(){
  97. let that = this
  98. let params={
  99. typeId:that.typeId,
  100. pageNo:that.pageNo,
  101. pageSize:that.pageSize
  102. }
  103. queryOrderList(params).then(response=>{
  104. console.info("queryOrderList",response)
  105. response.result.records.forEach((items,indexs)=>{
  106. if(items.carrentGoods){
  107. if(items.carrentGoods.image){
  108. items.carrentGoods.images = items.carrentGoods.image.split(',')
  109. }else{
  110. items.carrentGoods.images = []
  111. }
  112. }
  113. })
  114. that.list = that.list.concat(response.result.records)
  115. }).catch(error=>{
  116. })
  117. },
  118. onCustomerService(phone){
  119. let that = this
  120. if (uni.canIUse('makePhoneCall')) {
  121. uni.makePhoneCall({
  122. phoneNumber: String(phone),
  123. success: function () {
  124. console.log('拨打电话成功');
  125. },
  126. fail: function () {
  127. console.log('拨打电话失败');
  128. }
  129. });
  130. } else {
  131. console.log('你的设备不支持拨打电话功能');
  132. }
  133. }
  134. }
  135. }
  136. </script>
  137. <style>
  138. </style>