feat:修改登录接口 未完成
This commit is contained in:
parent
009a5ab8b1
commit
54611ac73c
@ -1,12 +1,14 @@
|
|||||||
const login = '/users/admin-login' //登录
|
const login = '/users/admin-login' //登录
|
||||||
const loginInfo = '/users/get-info' //登录信息
|
const loginInfo = '/users/get-info' //登录信息
|
||||||
|
|
||||||
|
const getPartnerList = '/dealer/get-list'//经销商列表
|
||||||
const getPartner = '/dealer/get-one' //经销商信息
|
const getPartner = '/dealer/get-one' //经销商信息
|
||||||
|
const editPartner = '/dealer/modify' //修改经销商信息
|
||||||
|
|
||||||
const getPackageList = '/new-install/packages' //套餐购买列表
|
const getPackageList = '/new-install/packages' //套餐购买列表
|
||||||
|
|
||||||
|
|
||||||
const createNewOrder = '/new-install/create' //创建新装工单
|
const createNewOrder = '/new-install/create' //创建新装工单
|
||||||
|
|
||||||
const phoneSearch = '/customer/phone-search' //搜索客户电话
|
const phoneSearch = '/customer/phone-search' //搜索客户电话
|
||||||
const getproductList = '/water/dealer/deposit_pack_product'//新增工单产品
|
const getproductList = '/water/dealer/deposit_pack_product'//新增工单产品
|
||||||
|
|
||||||
@ -28,8 +30,69 @@ const getOrderPairList = '/order-repair/list'
|
|||||||
const getOrderPairListInfo = '/order-repair/one'
|
const getOrderPairListInfo = '/order-repair/one'
|
||||||
|
|
||||||
const assignPartReplaceMaster = '/part_replace/assign' //指派
|
const assignPartReplaceMaster = '/part_replace/assign' //指派
|
||||||
|
|
||||||
|
const getNewOrder = '/new-install/list' //新增工单列表
|
||||||
|
const newOrderDesc = '/new-install/one' //新装工单详情
|
||||||
|
const BeActive = '/new-install/active-device' //新装工单激活
|
||||||
|
const completeNewOrder = '/new-install/complete' //新装工单完成
|
||||||
|
const cancelNewOrder = '/water/new-install-cancel'
|
||||||
|
|
||||||
|
|
||||||
|
const gerRepairOrder = '/order-repair/list' //维修工单列表
|
||||||
|
const RepairOrderDesc = '/order-repair/one'//维修工单详情
|
||||||
|
const completeRepairOrder = '/order-repair/complete'//完成维修工单
|
||||||
|
const assignRepairMaster = '/order-repair/assign' //维修工单指派师傅
|
||||||
|
|
||||||
|
|
||||||
|
const getPartOrder = '/part_replace/list' //更换工单列表
|
||||||
|
const PartOrderDesc = '/part_replace/one' //滤芯更换详情
|
||||||
|
const completePartOrder = '/part_replace/complete-part-replace'//完成更换
|
||||||
|
|
||||||
|
const getUninstallOrder = '/uninstall/list' //拆除工单列表
|
||||||
|
const getUninstallDesc = '/uninstall/one' //拆除工单详情
|
||||||
|
const unintsall = '/uninstall/complete' //完成拆除
|
||||||
|
const operate = '/uninstall/operate' //报废 入库
|
||||||
|
|
||||||
|
const boardInfo = '/waters/board-info-query'
|
||||||
|
const getDeviceByCode = '/device/qrcode' //扫码
|
||||||
|
const ScanQrcodeInNewOrder = '/water/new-install-device-code'
|
||||||
|
const allocation = '/device/allocation' //设备分配
|
||||||
|
|
||||||
|
const UninstallAllocation = '/uninstall/allocation'//分配拆除工单
|
||||||
|
|
||||||
|
|
||||||
|
const getEquipmentStock = '/product/inventory-list'//设备库存
|
||||||
|
const getEquipmentStockInfo = '/inventory/info' //设备库存-设备详情
|
||||||
|
const getFilterStock = ''
|
||||||
|
const getFilterStockInfo = ''
|
||||||
|
|
||||||
const apiArr = {
|
const apiArr = {
|
||||||
|
getDeviceByCode,
|
||||||
|
assignRepairMaster,
|
||||||
|
UninstallAllocation,
|
||||||
|
ScanQrcodeInNewOrder,
|
||||||
|
getEquipmentStock,
|
||||||
|
getEquipmentStockInfo,
|
||||||
|
allocation,
|
||||||
|
operate,
|
||||||
|
unintsall,
|
||||||
|
completeRepairOrder,
|
||||||
|
newOrderDesc,
|
||||||
|
BeActive,
|
||||||
|
getPartnerList,
|
||||||
|
completeNewOrder,
|
||||||
|
completePartOrder,
|
||||||
|
cancelNewOrder,
|
||||||
|
editPartner,
|
||||||
|
RepairOrderDesc,
|
||||||
|
PartOrderDesc,
|
||||||
|
getUninstallDesc,
|
||||||
|
boardInfo,
|
||||||
createMaster,
|
createMaster,
|
||||||
|
getNewOrder,
|
||||||
|
gerRepairOrder,
|
||||||
|
getPartOrder,
|
||||||
|
getUninstallOrder,
|
||||||
getOrderPairList,
|
getOrderPairList,
|
||||||
getOrderPairListInfo,
|
getOrderPairListInfo,
|
||||||
masterSelect,
|
masterSelect,
|
||||||
|
|||||||
@ -50,7 +50,6 @@ const deviceDesc = '/device/one' //设备详情
|
|||||||
|
|
||||||
// const newOrderList = '/wechat/water/dealer/get_list_new_install' //新装工单列表
|
// const newOrderList = '/wechat/water/dealer/get_list_new_install' //新装工单列表
|
||||||
const newOrderList = '/new-install/list' //新装工单列表
|
const newOrderList = '/new-install/list' //新装工单列表
|
||||||
|
|
||||||
const userNewOrderList = '/wechat/water/new-install-list' //微信新装工单列表
|
const userNewOrderList = '/wechat/water/new-install-list' //微信新装工单列表
|
||||||
|
|
||||||
|
|
||||||
@ -142,7 +141,31 @@ const scanOrder = '/wechat/trans-order/confirm' //查询是否有转账
|
|||||||
const queryOrder = '/wechat/trans-order/success' //确认是否转账
|
const queryOrder = '/wechat/trans-order/success' //确认是否转账
|
||||||
|
|
||||||
const BeActive = '/wechat/water/dealer/active-device' //激活设备
|
const BeActive = '/wechat/water/dealer/active-device' //激活设备
|
||||||
|
|
||||||
|
const UninstallOrder = '/uninstall/create'//创建拆机工单
|
||||||
|
const deviceActive = '/device/active' //设备激活
|
||||||
|
const deviceDataForce = '/waters/board-data-force' //流量充值
|
||||||
|
const deviceDeactivation = '/waters/board-deactivation' //时长充值
|
||||||
|
const deviceToTime = '/waters/billing-mode-to-time' //转时长
|
||||||
|
const deviceToTraffic = '/waters/billing-mode-to-traffic' //转流量
|
||||||
|
const deviceToRetail = '/waters/billing-mode-to-retail' //转零售
|
||||||
|
|
||||||
|
|
||||||
|
const getServerInfo = '/wechat/cus-server-info' //平台客服 二维码
|
||||||
|
const cusGetServerInfo = '/wechat/water/get-customer-service' //用户获取平台二维码
|
||||||
|
|
||||||
|
const getTrans = '/wechat/water/trans' //品宣金
|
||||||
const apiArr = {
|
const apiArr = {
|
||||||
|
getServerInfo,
|
||||||
|
cusGetServerInfo,
|
||||||
|
getTrans,
|
||||||
|
deviceDeactivation,
|
||||||
|
deviceToTime,
|
||||||
|
deviceToTraffic,
|
||||||
|
deviceDataForce,
|
||||||
|
deviceActive,
|
||||||
|
deviceToRetail,
|
||||||
|
UninstallOrder,
|
||||||
cancelActivation,
|
cancelActivation,
|
||||||
queryOrder,
|
queryOrder,
|
||||||
createUninstallOrder,
|
createUninstallOrder,
|
||||||
|
|||||||
27
app.json
27
app.json
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"pages": [
|
"pages": [
|
||||||
|
"pages/newLogin/newLogin",
|
||||||
"pages/chooseEntrance/chooseEntrance",
|
"pages/chooseEntrance/chooseEntrance",
|
||||||
"pages/water_filter/water_filter",
|
"pages/water_filter/water_filter",
|
||||||
"pages/info/info",
|
"pages/info/info",
|
||||||
@ -16,8 +17,10 @@
|
|||||||
"pages/newOrderList/newOrderList",
|
"pages/newOrderList/newOrderList",
|
||||||
"pages/newOrderListDesc/index",
|
"pages/newOrderListDesc/index",
|
||||||
"pages/RechargeRecord/RechargeRecord",
|
"pages/RechargeRecord/RechargeRecord",
|
||||||
|
"pages/RechargeRecordDesc/RechargeRecordDesc",
|
||||||
"pages/filterChange/filterChange",
|
"pages/filterChange/filterChange",
|
||||||
"pages/SubscribeMessage/SubscribeMessage"
|
"pages/SubscribeMessage/SubscribeMessage",
|
||||||
|
"pages/renewalRecord/renewalRecord"
|
||||||
],
|
],
|
||||||
"subPackages": [
|
"subPackages": [
|
||||||
{
|
{
|
||||||
@ -72,12 +75,14 @@
|
|||||||
{
|
{
|
||||||
"root": "packages/master",
|
"root": "packages/master",
|
||||||
"pages":[
|
"pages":[
|
||||||
|
"masterIndex/index",
|
||||||
"order/index",
|
"order/index",
|
||||||
"orderDesc/index",
|
"orderDesc/index",
|
||||||
"PersonCen/index",
|
"PersonCen/index",
|
||||||
"masterInfo/index",
|
"masterInfo/index",
|
||||||
"device/index",
|
"device/index",
|
||||||
"deviceInfo/index"
|
"deviceInfo/index",
|
||||||
|
"addNewOrder/index"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -85,6 +90,9 @@
|
|||||||
"pages": [
|
"pages": [
|
||||||
"pages/login/login",
|
"pages/login/login",
|
||||||
"pages/partner",
|
"pages/partner",
|
||||||
|
"pages/OrderMsg/OrderMsg",
|
||||||
|
"pages/OrderMsgInfo/OrderMsgInfo",
|
||||||
|
"pages/distributor/distributor",
|
||||||
"pages/purchaseGoods/purchaseGoods",
|
"pages/purchaseGoods/purchaseGoods",
|
||||||
"pages/WorkOrder/WorkOrder",
|
"pages/WorkOrder/WorkOrder",
|
||||||
"pages/newWorkOrder/newWorkOrder",
|
"pages/newWorkOrder/newWorkOrder",
|
||||||
@ -103,7 +111,20 @@
|
|||||||
"pages/income/income",
|
"pages/income/income",
|
||||||
"pages/incomeDesc/incomeDesc",
|
"pages/incomeDesc/incomeDesc",
|
||||||
"pages/incomeDetail/incomeDetail",
|
"pages/incomeDetail/incomeDetail",
|
||||||
"pages/addNewOrder/addNewOrder"
|
"pages/addNewOrder/addNewOrder",
|
||||||
|
"pages/chooseDevice/chooseDevice",
|
||||||
|
"pages/chooseRepairDevice/chooseRepairDevice",
|
||||||
|
"pages/editAdmin/editAdmin",
|
||||||
|
"pages/device/device",
|
||||||
|
"pages/equipmentStock/equipmentStock",
|
||||||
|
"pages/filterStock/filterStock",
|
||||||
|
"pages/filterStockInfo/filterStockInfo",
|
||||||
|
"pages/deviceDesc/deviceDesc",
|
||||||
|
"pages/mine/mine",
|
||||||
|
"pages/marketingOrder1/marketingOrder1",
|
||||||
|
"pages/marketingOrder2/marketingOrder2",
|
||||||
|
"pages/order1/order1",
|
||||||
|
"pages/order2/order2"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@ -16,8 +16,8 @@ Component({
|
|||||||
data: {
|
data: {
|
||||||
nav_list:[
|
nav_list:[
|
||||||
{
|
{
|
||||||
url:"/packages/master/order/index",
|
url:"/packages/master/masterIndex/index",
|
||||||
nav_name:"订单",
|
nav_name:"首页",
|
||||||
photo:"https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/partner/partner_icon3.png?1"
|
photo:"https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/partner/partner_icon3.png?1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
50
component/partnerFooter/index.js
Normal file
50
component/partnerFooter/index.js
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
import apiAddr from '../../api/base';
|
||||||
|
import { setData } from '../../utils/index';
|
||||||
|
|
||||||
|
Component({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的属性列表
|
||||||
|
*/
|
||||||
|
properties: {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
nav_list:[
|
||||||
|
{
|
||||||
|
url:"/packages/partner/pages/partner",
|
||||||
|
nav_name:"首页",
|
||||||
|
photo:"https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/partner/partner_icon3.png?1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url:"/packages/partner/pages/mine/mine",
|
||||||
|
nav_name:"我的",
|
||||||
|
photo:"https://zhsq.hshuishang.com/attachs/navigation/2024/12/23/6768c0b16ce89.png"
|
||||||
|
},
|
||||||
|
],
|
||||||
|
foot_width:'50%',
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的方法列表
|
||||||
|
*/
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
jump(e){
|
||||||
|
wx.redirectTo({
|
||||||
|
url: e.currentTarget.dataset.url,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
lifetimes: {
|
||||||
|
attached: function () {
|
||||||
|
// 组件被添加到页面节点树时执行
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
4
component/partnerFooter/index.json
Normal file
4
component/partnerFooter/index.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"component": true,
|
||||||
|
"usingComponents": {}
|
||||||
|
}
|
||||||
9
component/partnerFooter/index.wxml
Normal file
9
component/partnerFooter/index.wxml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<view class="foot-fixed">
|
||||||
|
<block wx:for="{{nav_list}}" wx:key="unique">
|
||||||
|
<!-- <view>{{item.photo}}</view> -->
|
||||||
|
<view id="navIndex" bind:tap="jump" data-idx="{{index}}" data-url="{{item.url}}" style="width:{{foot_width}}" class="foot-item">
|
||||||
|
<view class="foot-icon" style="background: url({{item.photo}}) center center no-repeat; background-size: contain;"></view>
|
||||||
|
<text class="foot-label" id="navIndexLabel">{{item.nav_name}}</text>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
</view>
|
||||||
3
component/partnerFooter/index.wxss
Normal file
3
component/partnerFooter/index.wxss
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/* pages/public/footer.wxss */
|
||||||
|
@import "../../app.wxss";
|
||||||
|
|
||||||
132
component/wan-select/index.js
Normal file
132
component/wan-select/index.js
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
// components/wan-select/select.js
|
||||||
|
Component({
|
||||||
|
options: {
|
||||||
|
addGlobalClass: true,
|
||||||
|
},
|
||||||
|
properties: {
|
||||||
|
/* --------- 样式参数 --------- */
|
||||||
|
titleWidth: { // 标题长度
|
||||||
|
type: String,
|
||||||
|
value: "60px"
|
||||||
|
},
|
||||||
|
bgColor: { // 输入框背景颜色
|
||||||
|
type: String,
|
||||||
|
value: "#fff"
|
||||||
|
},
|
||||||
|
itemBgColor: { // 选中的选项背景颜色
|
||||||
|
type: String,
|
||||||
|
value: "#F5F8FE"
|
||||||
|
},
|
||||||
|
textColor: { // 选中的字体颜色
|
||||||
|
type: String,
|
||||||
|
value: "#3772E9"
|
||||||
|
},
|
||||||
|
/* --------- 数据参数 --------- */
|
||||||
|
title: { // 下拉框标题
|
||||||
|
type: String,
|
||||||
|
value: ""
|
||||||
|
},
|
||||||
|
options: { // 选项数组
|
||||||
|
type: Array,
|
||||||
|
value: [],
|
||||||
|
},
|
||||||
|
labelName: { // 选项数组-绑定的label名称
|
||||||
|
type: String,
|
||||||
|
value: "dictLabel",
|
||||||
|
},
|
||||||
|
valueName: { // 选项数组-绑定的value名称
|
||||||
|
type: String,
|
||||||
|
value: "dictValue"
|
||||||
|
},
|
||||||
|
modelValue: { // 绑定的value
|
||||||
|
type: String,
|
||||||
|
value: "",
|
||||||
|
observer: function () {
|
||||||
|
//如果有默认值,需要匹配出name,所以这里使用obersver,当父组件中值改变时触发
|
||||||
|
this.handleData();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
placeholder: { // 输入框为空时占位符
|
||||||
|
type: String,
|
||||||
|
value: "请选择"
|
||||||
|
},
|
||||||
|
disabled: { // 是否禁用
|
||||||
|
type: Boolean,
|
||||||
|
value: false
|
||||||
|
},
|
||||||
|
readonly: { // 是否只读
|
||||||
|
type: Boolean,
|
||||||
|
value: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
show: false, //选项框及图标展示
|
||||||
|
selectValue: "", //选中的value
|
||||||
|
selectLabel: "", //选中的label
|
||||||
|
toTop: false, // 下拉框是否展示在输入框上方
|
||||||
|
},
|
||||||
|
attached() {
|
||||||
|
this.handleData()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 清空输入框
|
||||||
|
clearInput() {
|
||||||
|
this.setData({
|
||||||
|
selectValue: "", //选中的value
|
||||||
|
selectLabel: "", //选中的label
|
||||||
|
show: false,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 下拉框收起和展开
|
||||||
|
changeShow(e) {
|
||||||
|
let that = this
|
||||||
|
const query = wx.createSelectorQuery();
|
||||||
|
// 选择当前点击的 view 元素
|
||||||
|
query.select('.inputPlaceholder').boundingClientRect();
|
||||||
|
query.exec(function (res) { // res[0].bottom 是元素距离可视区域顶部的距离加上元素自身的高度; res[1].scrollTop 是页面的滚动距离
|
||||||
|
var show = !that.data.show
|
||||||
|
if (res[0]) {
|
||||||
|
/* that.triggerEvent("handleShow", show); // [暂未发现]处理滚动选项区域时背景页面滚动问题 */
|
||||||
|
let toBottom = wx.getSystemInfoSync().windowHeight - res[0].bottom;
|
||||||
|
console.log('距离设备底部的距离:', toBottom);
|
||||||
|
that.setData({
|
||||||
|
toTop: toBottom < 160 ? true : false,
|
||||||
|
show: show
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
that.setData({ show: show })
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 选择数据后回显
|
||||||
|
handleChange(e) {
|
||||||
|
let { item } = e.currentTarget.dataset
|
||||||
|
let { labelName, valueName } = this.data
|
||||||
|
this.setData({
|
||||||
|
selectValue: item[valueName],
|
||||||
|
selectLabel: item[labelName],
|
||||||
|
show: false
|
||||||
|
})
|
||||||
|
let obj = {}
|
||||||
|
obj[valueName] = item[valueName]
|
||||||
|
obj[labelName] = item[labelName]
|
||||||
|
this.triggerEvent("handleChange", obj);// 传参
|
||||||
|
},
|
||||||
|
// 匹配值并回显
|
||||||
|
handleData() {
|
||||||
|
let { modelValue, options, valueName, labelName } = this.properties;
|
||||||
|
if (modelValue) {
|
||||||
|
let item = options.find(r => r[valueName] == modelValue)
|
||||||
|
this.setData({
|
||||||
|
selectLabel: item ? item[labelName] : modelValue,
|
||||||
|
selectValue: modelValue,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
5
component/wan-select/index.json
Normal file
5
component/wan-select/index.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"component": true,
|
||||||
|
"usingComponents": {}
|
||||||
|
}
|
||||||
|
|
||||||
40
component/wan-select/index.wxml
Normal file
40
component/wan-select/index.wxml
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
<!--components/wan-select/select.wxml-->
|
||||||
|
<view class="w100 select_all_view">
|
||||||
|
<!-- 标题,可以没有 -->
|
||||||
|
<view class="mr-10 pt-10 size-28" style="width: {{titleWidth}};" wx:if="{{title}}">{{title}}</view>
|
||||||
|
<view class="select_view relative" style="width: {{title ? 'calc(100% - ' + titleWidth + ' - 10rpx)' : '100%'}};max-width: {{title ? 'calc(100% - ' + titleWidth + ' - 10rpx)' : '100%'}};">
|
||||||
|
<view class="inputPlaceholder h100 w100 radius-10 relative flex_l pd-10 {{ disabled ? 'gray-3' : 'black' }}" bindtap="{{disabled || readonly ? '' : 'changeShow'}}" style="background: {{disabled ?'#f5f7fa' : bgColor}};border: 2rpx solid #ddd;">
|
||||||
|
<block wx:if="{{disabled || readonly}}">
|
||||||
|
<view class="flex-1" wx:if="{{selectLabel}}">{{selectLabel}}</view>
|
||||||
|
<view class="flex-1 gray-3 line-1" wx:else>{{placeholder}}</view>
|
||||||
|
<van-icon class="gray-3" name="arrow-down" />
|
||||||
|
</block>
|
||||||
|
<block wx:else>
|
||||||
|
<block wx:if="{{selectLabel}}">
|
||||||
|
<!-- <view class="flex-1">{{selectLabel}}</view>
|
||||||
|
<van-icon class="gray-3" name="clear" wx:if='{{!show}}' catchtap="clearInput" />
|
||||||
|
<van-icon class="gray-3" name="arrow-up" wx:else /> -->
|
||||||
|
<view class="flex-1">{{selectLabel}}</view>
|
||||||
|
<van-icon class="gray-3" name="arrow-down" wx:if='{{!show}}' />
|
||||||
|
<van-icon class="gray-3" name="arrow-up" wx:else />
|
||||||
|
</block>
|
||||||
|
<block wx:else>
|
||||||
|
<view class="flex-1 gray-3 line-1">{{placeholder}}</view>
|
||||||
|
<van-icon class="gray-3" name="arrow-down" class="transfer {{show ? 'is-reverse' : 'no-reverse' }}" />
|
||||||
|
</block>
|
||||||
|
</block>
|
||||||
|
</view>
|
||||||
|
<!-- 下拉展开后的可选择内容 -->
|
||||||
|
<block wx:if='{{show}}'>
|
||||||
|
<view class="{{toTop ? 'triangleBox-top' : 'triangleBox'}}">
|
||||||
|
<view class="{{toTop ? 'triangle-top' : 'triangle'}}"></view>
|
||||||
|
</view>
|
||||||
|
<view class="content radius-10 pd-20 size-28" style="{{toTop ? 'top: -' + (options.length > 4 ? 296 : (options.length * 64 + 40)) + 'rpx; margin-top: -10rpx;' : 'margin-top: 10rpx;'}}">
|
||||||
|
<view class="pd-10 center gray-3" wx:if="{{options.length < 1}}">暂无数据</view>
|
||||||
|
<view class="line-1 w100 pd-10 contentItem {{item[valueName] == selectValue ? 'bold':''}}" wx:for="{{options}}" wx:key="index" bindtap="handleChange" data-item="{{item}}" style="color: {{ item[valueName] == selectValue ? textColor : '#000'}}; background: {{item[valueName] == selectValue ? itemBgColor:''}};">
|
||||||
|
{{item[labelName]}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
100
component/wan-select/index.wxss
Normal file
100
component/wan-select/index.wxss
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
/* components/wan-select/select.wxss */
|
||||||
|
.select_all_view {
|
||||||
|
display: flex;
|
||||||
|
justify-content: start;
|
||||||
|
align-items: start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select_view {
|
||||||
|
/* min-width: 200rpx; */
|
||||||
|
min-height: 64rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.inputPlaceholder {
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
position: absolute;
|
||||||
|
right: 12rpx;
|
||||||
|
top: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contentItem {
|
||||||
|
height: 64rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
width: calc(100% - 4px);
|
||||||
|
margin-left: 2px;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 999;
|
||||||
|
max-height: 296rpx;
|
||||||
|
background: #FFFFFF;
|
||||||
|
/* border: 1px solid #ccc; */
|
||||||
|
box-shadow: 0 0 4px #ccc;
|
||||||
|
opacity: 1;
|
||||||
|
/* margin-top: 10rpx; */
|
||||||
|
overflow-x: hidden;
|
||||||
|
overflow-y: scroll;
|
||||||
|
}
|
||||||
|
|
||||||
|
.triangleBox {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 1000;
|
||||||
|
left: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.triangle {
|
||||||
|
position: relative;
|
||||||
|
border-left: 12rpx solid transparent;
|
||||||
|
border-right: 12rpx solid transparent;
|
||||||
|
border-bottom: 10rpx solid #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.triangle::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 3rpx;
|
||||||
|
left: -12rpx;
|
||||||
|
border-left: 12rpx solid transparent;
|
||||||
|
border-right: 12rpx solid transparent;
|
||||||
|
border-bottom: 10rpx solid #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.triangleBox-top {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 1000;
|
||||||
|
left: 30rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.triangle-top {
|
||||||
|
position: relative;
|
||||||
|
border-left: 12rpx solid transparent;
|
||||||
|
border-right: 12rpx solid transparent;
|
||||||
|
border-top: 10rpx solid #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.triangle-top::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
bottom: 3rpx;
|
||||||
|
left: -12rpx;
|
||||||
|
border-left: 12rpx solid transparent;
|
||||||
|
border-right: 12rpx solid transparent;
|
||||||
|
border-top: 10rpx solid #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.is-reverse {
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.transfer {
|
||||||
|
transition: transform .3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.no-reverse {
|
||||||
|
transition: rotate(0deg);
|
||||||
|
}
|
||||||
|
|
||||||
@ -1,3 +1,5 @@
|
|||||||
|
let util = require('../../../../utils/util')
|
||||||
|
let apiArr = require('../../../../api/water_filter')
|
||||||
// packages/WaterPurifier/pages/Addfriend/Addfriend.js
|
// packages/WaterPurifier/pages/Addfriend/Addfriend.js
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
@ -8,7 +10,7 @@ Page({
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
save(){
|
save() {
|
||||||
wx.downloadFile({
|
wx.downloadFile({
|
||||||
url: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/customer.jpg',
|
url: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/customer.jpg',
|
||||||
success(res) {
|
success(res) {
|
||||||
@ -42,7 +44,26 @@ Page({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getServerInfo() {
|
||||||
|
let that = this
|
||||||
|
util.postUrl(apiArr.cusGetServerInfo, {
|
||||||
|
device_id:wx.getStorageSync('device_id')
|
||||||
|
}, res => {
|
||||||
|
res.qr_code = res.qr_code.startsWith('http') ? res.qr_code : util.img_url + res.qr_code
|
||||||
|
console.log(res.qr_code);
|
||||||
|
that.setData({
|
||||||
|
serverInfo: res
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
call(){
|
||||||
|
let that = this
|
||||||
|
wx.makePhoneCall({
|
||||||
|
phoneNumber: that.data.serverInfo.customer_phone,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
@ -52,6 +73,7 @@ Page({
|
|||||||
withShareTicket: true,
|
withShareTicket: true,
|
||||||
menus: ['shareAppMessage', 'shareTimeline']
|
menus: ['shareAppMessage', 'shareTimeline']
|
||||||
})
|
})
|
||||||
|
this.getServerInfo()
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -99,18 +121,18 @@ Page({
|
|||||||
/**
|
/**
|
||||||
* 用户点击右上角分享
|
* 用户点击右上角分享
|
||||||
*/
|
*/
|
||||||
onShareAppMessage(){
|
onShareAppMessage() {
|
||||||
return {
|
return {
|
||||||
title: '人人爱净水', // 分享卡片标题(必填)
|
title: '人人爱净水', // 分享卡片标题(必填)
|
||||||
path: '/pages/water_filter/water_filter', // 用户点击后跳转的路径(可选,默认当前页)
|
path: '/pages/water_filter/water_filter', // 用户点击后跳转的路径(可选,默认当前页)
|
||||||
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义图片(可选,比例建议 5:4)
|
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义图片(可选,比例建议 5:4)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShareTimeline() {
|
onShareTimeline() {
|
||||||
return {
|
return {
|
||||||
title: '人人爱净水', // 自定义标题
|
title: '人人爱净水', // 自定义标题
|
||||||
query: '', // 自定义页面路径中的参数
|
query: '', // 自定义页面路径中的参数
|
||||||
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义分享图片路径
|
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义分享图片路径
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ -1,5 +1,10 @@
|
|||||||
<view class="box">
|
<view class="box">
|
||||||
<image id="img" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/customer.jpg" mode="widthFix"/>
|
|
||||||
|
|
||||||
<view class="btn" bind:tap="save">保存到相册</view>
|
<view class="row" bind:tap="call">
|
||||||
|
<view class="label">客服电话:</view>
|
||||||
|
<view class="con">{{serverInfo.customer_phone}}<van-icon name="phone-o" /></view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<image id="img" show-menu-by-longpress src="{{serverInfo.qr_code}}" mode="widthFix" />
|
||||||
|
<span>长按保存二维码</span>
|
||||||
</view>
|
</view>
|
||||||
@ -3,28 +3,29 @@ image {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.box{
|
.box {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
}
|
}
|
||||||
.btn {
|
|
||||||
width: 650rpx;
|
.row {
|
||||||
height: 80rpx;
|
margin-top: 100rpx;
|
||||||
background: #2583FF;
|
|
||||||
border-radius: 100rpx 100rpx 100rpx 100rpx;
|
|
||||||
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 36rpx;
|
|
||||||
color: #FFFFFF;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin-top: 120rpx;
|
font-size: 30rpx;
|
||||||
|
color: #000;
|
||||||
}
|
}
|
||||||
#img{
|
|
||||||
|
.label {
|
||||||
|
color: #999;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
#img {
|
||||||
width: 400rpx;
|
width: 400rpx;
|
||||||
margin-bottom: 300rpx;
|
margin-top: 120rpx;
|
||||||
|
margin-bottom: 60rpx;
|
||||||
}
|
}
|
||||||
@ -29,14 +29,6 @@ Page({
|
|||||||
name: "待支付",
|
name: "待支付",
|
||||||
type: "1"
|
type: "1"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "待发货",
|
|
||||||
type: "2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "已发货",
|
|
||||||
type: "3"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: "已支付",
|
name: "已支付",
|
||||||
type: "4"
|
type: "4"
|
||||||
@ -45,14 +37,6 @@ Page({
|
|||||||
name: "已取消",
|
name: "已取消",
|
||||||
type: "5"
|
type: "5"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "已失效",
|
|
||||||
type: "6"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "支付失败",
|
|
||||||
type: "7"
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
state: 0,
|
state: 0,
|
||||||
selectPackage: ""
|
selectPackage: ""
|
||||||
|
|||||||
@ -22,14 +22,11 @@
|
|||||||
<view class="payItem1">
|
<view class="payItem1">
|
||||||
<!-- <view class="payItem1_time">2024-12-20 10:31:48</view> -->
|
<!-- <view class="payItem1_time">2024-12-20 10:31:48</view> -->
|
||||||
<view class="payItem1_state1" wx:if="{{item.status == 1}}">待支付</view>
|
<view class="payItem1_state1" wx:if="{{item.status == 1}}">待支付</view>
|
||||||
<view class="payItem1_state1" wx:if="{{item.status == 2}}">代发货</view>
|
<view class="payItem1_state1" wx:if="{{item.status == 4}}">已支付</view>
|
||||||
<view class="payItem1_state1" wx:if="{{item.status == 3}}">已发货</view>
|
|
||||||
<view class="payItem1_state1" wx:if="{{item.status ==4}}">已支付</view>
|
|
||||||
<view class="payItem1_state1" wx:if="{{item.status == 5}}">已取消</view>
|
<view class="payItem1_state1" wx:if="{{item.status == 5}}">已取消</view>
|
||||||
<view class="payItem1_state1" wx:if="{{item.status == 6}}">已失效</view>
|
<view class="payItem1_state1" wx:if="{{item.status !== 5 && item.status !== 1 && item.status !== 4}}">其他</view>
|
||||||
<view class="payItem1_state1" wx:if="{{item.status == 7}}">支付失败</view>
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<van-divider />
|
<van-divider />
|
||||||
<view class="payItem_row">
|
<view class="payItem_row">
|
||||||
<view class="payItem_title">订单名称</view>
|
<view class="payItem_title">订单名称</view>
|
||||||
@ -40,8 +37,8 @@
|
|||||||
<view class="payItem_con">{{item.order_no}}</view>
|
<view class="payItem_con">{{item.order_no}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="payItem_row">
|
<view class="payItem_row">
|
||||||
<view class="payItem_title">本次购买</view>
|
<view class="payItem_title">套餐名称</view>
|
||||||
<view class="payItem_con">{{item.pay_time}}</view>
|
<view class="payItem_con">{{item.package_name}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="payItem_row">
|
<view class="payItem_row">
|
||||||
<view class="payItem_title">支付方式</view>
|
<view class="payItem_title">支付方式</view>
|
||||||
@ -55,6 +52,11 @@
|
|||||||
<view class="payItem_title">金额</view>
|
<view class="payItem_title">金额</view>
|
||||||
<view class="payItem_con">¥{{item.total_price}}</view>
|
<view class="payItem_con">¥{{item.total_price}}</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="payItem_row">
|
||||||
|
<view class="payItem_title">支付时间</view>
|
||||||
|
<view class="payItem_con">{{item.pay_time}}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<view class="payItem_payBox">
|
<view class="payItem_payBox">
|
||||||
<view class="payItem_pay" bind:tap="pay2" data-item="{{item}}" wx:if="{{item.status == 1}}">
|
<view class="payItem_pay" bind:tap="pay2" data-item="{{item}}" wx:if="{{item.status == 1}}">
|
||||||
去支付
|
去支付
|
||||||
|
|||||||
@ -0,0 +1,403 @@
|
|||||||
|
let util = require("../../../../../utils/util")
|
||||||
|
const apiArr = require('../../../../../api/water_filter')
|
||||||
|
const { postUrl3 } = require("../../../../../utils/util")
|
||||||
|
|
||||||
|
// packages/WaterPurifier/pages/device/deviceDesc/deviceDesc.js
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
progress_List: [{
|
||||||
|
"name": "HXTH滤芯",
|
||||||
|
"progress": 97.41
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "RO膜滤芯",
|
||||||
|
"progress": 87.41
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PP+CB滤芯",
|
||||||
|
"progress": 40.41
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PP棉滤芯",
|
||||||
|
"progress": 90.41
|
||||||
|
}
|
||||||
|
],
|
||||||
|
device_id: "",
|
||||||
|
Info: {},
|
||||||
|
show: false,
|
||||||
|
show2: false,
|
||||||
|
show3: false,
|
||||||
|
remarks1: "",
|
||||||
|
remainingDays: "",
|
||||||
|
surplusFlow: "",
|
||||||
|
},
|
||||||
|
|
||||||
|
getInfo() {
|
||||||
|
let that = this
|
||||||
|
util.postUrl(apiArr.deviceDesc, {
|
||||||
|
device_id: Number(that.data.device_id)
|
||||||
|
}, res => {
|
||||||
|
if (res.device_part) {
|
||||||
|
res.device_part.forEach(item => {
|
||||||
|
item.shengyuTime = that.getDaysDifference(item.expiration_time)
|
||||||
|
item.parent = Math.round((Number(item.shengyuTime) / Number(item.availableDays) * 100))
|
||||||
|
})
|
||||||
|
|
||||||
|
const first = res.device_part.findIndex(item =>
|
||||||
|
item.parts_name.indexOf("PP棉滤芯") !== -1
|
||||||
|
);
|
||||||
|
if (first !== -1) {
|
||||||
|
const [removed] = res.device_part.splice(first, 1); // 移除该对象
|
||||||
|
res.device_part.unshift(removed); // 插入到首位
|
||||||
|
}
|
||||||
|
|
||||||
|
const Second = res.device_part.findIndex(item =>
|
||||||
|
item.parts_name.indexOf("PP+CB") !== -1
|
||||||
|
);
|
||||||
|
if (Second !== -1) {
|
||||||
|
const [removed] = res.device_part.splice(Second, 1); // 移除该对象
|
||||||
|
res.device_part.splice(1, 0, removed); // 插入到第二位
|
||||||
|
}
|
||||||
|
|
||||||
|
const Third = res.device_part.findIndex(item =>
|
||||||
|
item.parts_name.indexOf("RO") !== -1
|
||||||
|
);
|
||||||
|
if (Third !== -1) {
|
||||||
|
const [removed] = res.device_part.splice(Third, 1); // 移除该对象
|
||||||
|
res.device_part.splice(2, 0, removed); // 插入到第二位
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const Fourth = res.device_part.findIndex(item =>
|
||||||
|
item.parts_name.indexOf("后置活性炭") !== -1
|
||||||
|
);
|
||||||
|
if (Fourth !== -1) {
|
||||||
|
const [removed] = res.device_part.splice(Fourth, 1); // 移除该对象
|
||||||
|
res.device_part.splice(3, 0, removed); // 插入到第二位
|
||||||
|
}
|
||||||
|
}
|
||||||
|
that.setData({
|
||||||
|
Info: res
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
getDaysDifference(targetDate) {
|
||||||
|
// 获取当前时间
|
||||||
|
const now = new Date();
|
||||||
|
// 将传递的时间转换为日期对象
|
||||||
|
const target = new Date(targetDate);
|
||||||
|
// 计算时间差(以毫秒为单位)
|
||||||
|
const timeDiff = target.getTime() - now.getTime();
|
||||||
|
// 将毫秒转换为天数
|
||||||
|
const daysDiff = Math.ceil(timeDiff / (1000 * 60 * 60 * 24));
|
||||||
|
return daysDiff;
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
//开机
|
||||||
|
Open() {
|
||||||
|
let that = this
|
||||||
|
util.postUrl2(apiArr.openOff, {
|
||||||
|
deviceId: that.data.Info.device_id,
|
||||||
|
onOff: 1
|
||||||
|
}, res => {
|
||||||
|
if (res.data.params.sevice_status.value == '10') {
|
||||||
|
wx.showToast({
|
||||||
|
title: '开机成功!',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
that.getInfo()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//关机
|
||||||
|
Close() {
|
||||||
|
let that = this
|
||||||
|
util.postUrl2(apiArr.openOff, {
|
||||||
|
deviceId: that.data.Info.device_id,
|
||||||
|
onOff: 2
|
||||||
|
}, res => {
|
||||||
|
if (res.data.params.sevice_status.value == '00') {
|
||||||
|
wx.showToast({
|
||||||
|
title: '关机成功!',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
that.getInfo()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 拆机
|
||||||
|
uninstall() {
|
||||||
|
let that = this
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '请确保设备通电开机状态,该操作将取消设备激活状态',
|
||||||
|
complete: (res) => {
|
||||||
|
if (res.cancel) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res.confirm) {
|
||||||
|
that.setData({
|
||||||
|
show: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
createUninstall() {
|
||||||
|
wx.showLoading({
|
||||||
|
title: '加载中...',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
let that = this
|
||||||
|
util.postUrl(apiArr.UninstallOrder, {
|
||||||
|
device_id: that.data.Info.device_id,
|
||||||
|
remark: that.data.remarks1
|
||||||
|
}, res => {
|
||||||
|
console.log(res);
|
||||||
|
wx.hideLoading()
|
||||||
|
wx.showToast({
|
||||||
|
title: '拆机工单创建完成',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
|
||||||
|
setTimeout(()=>{
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/packages/partner/pages/removeOrder/removeOrder',
|
||||||
|
})
|
||||||
|
},1500)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 激活
|
||||||
|
active() {
|
||||||
|
wx.showLoading({
|
||||||
|
title: '加载中...',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
let that = this
|
||||||
|
util.postUrl2(apiArr.deviceActive, {
|
||||||
|
device_id: that.data.Info.device_id
|
||||||
|
}, res => {
|
||||||
|
if (res.statusCode == 200) {
|
||||||
|
wx.showToast({
|
||||||
|
title: '激活成功',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
that.getInfo()
|
||||||
|
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: res.data.msg,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
wx.hideLoading()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//时长充值
|
||||||
|
recharge1() {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
show2: true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
deviceDeactivation() {
|
||||||
|
let that = this
|
||||||
|
if(!that.isPureNumber(that.data.remainingDays)){
|
||||||
|
return wx.showToast({
|
||||||
|
title: '请输入正确到期日期',
|
||||||
|
icon:"none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '确定要充值时长吗?请在设备通电开机的状态下进行操作',
|
||||||
|
complete: (res) => {
|
||||||
|
if (res.cancel) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res.confirm) {
|
||||||
|
wx.showLoading({
|
||||||
|
title: '加载中...',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
util.postUrl2(apiArr.deviceDeactivation, {
|
||||||
|
device_id: that.data.Info.device_id,
|
||||||
|
remainingDays: that.data.remainingDays
|
||||||
|
}, res => {
|
||||||
|
wx.hideLoading()
|
||||||
|
if (res.statusCode == 200) {
|
||||||
|
wx.showToast({
|
||||||
|
title: '充值成功',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
that.getInfo()
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: res.data.msg,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
that.setData({
|
||||||
|
show2: false,
|
||||||
|
remainingDays: ""
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeRemainingDay(e) {
|
||||||
|
console.log(e);
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
remainingDays: e.detail.value
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//流量充值
|
||||||
|
recharge2() {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
show3: true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeSurplusFlow(e) {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
surplusFlow: e.detail.value
|
||||||
|
})
|
||||||
|
},
|
||||||
|
deviceDataForce() {
|
||||||
|
let that = this
|
||||||
|
|
||||||
|
if(!that.isPureNumber(that.data.surplusFlow)){
|
||||||
|
return wx.showToast({
|
||||||
|
title: '请输入正确数额',
|
||||||
|
icon:"none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '确定要充值流量吗?请在设备通电开机的状态下进行操作',
|
||||||
|
complete: (res) => {
|
||||||
|
if (res.cancel) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res.confirm) {
|
||||||
|
util.postUrl2(apiArr.deviceDataForce, {
|
||||||
|
device_id: that.data.Info.device_id,
|
||||||
|
surplusFlow: that.data.surplusFlow
|
||||||
|
}, res => {
|
||||||
|
wx.hideLoading()
|
||||||
|
if (res.statusCode == 200) {
|
||||||
|
wx.showToast({
|
||||||
|
title: '充值成功',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
that.getInfo()
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: res.data.msg,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
that.setData({
|
||||||
|
show3: false,
|
||||||
|
surplusFlow: ""
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
isPureNumber(value) {
|
||||||
|
return /^\d+(\.\d+)?$/.test(value);
|
||||||
|
},
|
||||||
|
|
||||||
|
onClose() {
|
||||||
|
this.setData({
|
||||||
|
show: false,
|
||||||
|
show2: false,
|
||||||
|
show3: false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
remarksIpt1(e) {
|
||||||
|
console.log(e);
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
remarks1: e.detail.value
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
let that = this
|
||||||
|
console.log(options);
|
||||||
|
that.setData({
|
||||||
|
device_id: options.device_id
|
||||||
|
})
|
||||||
|
that.getInfo()
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
@ -0,0 +1,145 @@
|
|||||||
|
<view class="container">
|
||||||
|
<!-- 滑动 Tab 栏 -->
|
||||||
|
<!-- <scroll-view scroll-x scroll-with-animation scroll-into-view="{{ currentTabId }}" class="tab-scroll">
|
||||||
|
<view wx:for="{{ tabs }}" wx:key="index" id="tab{{ index }}" class="tab-item {{ currentTab === index ? 'active' : '' }}" bindtap="switchTab" data-index="{{ index }}">
|
||||||
|
{{ item }}
|
||||||
|
</view>
|
||||||
|
</scroll-view> -->
|
||||||
|
|
||||||
|
|
||||||
|
<view class="deviceInfo">
|
||||||
|
<view class="deviceInfo_Tit">设备编号:{{Info.device.device_code}}</view>
|
||||||
|
<view class="deviceInfo_Item">
|
||||||
|
<view class="deviceInfo_Item_ask">设备型号</view>
|
||||||
|
<view class="deviceInfo_Item_con">{{Info.device.product_name}}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="deviceInfo_Item">
|
||||||
|
<view class="deviceInfo_Item_ask">设备状态</view>
|
||||||
|
<view class="deviceInfo_Item_con">{{Info.device_net.active_status}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="deviceInfo_Item">
|
||||||
|
<view class="deviceInfo_Item_ask">原水值</view>
|
||||||
|
<view class="deviceInfo_Item_con">{{Info.device_net.raw_water_value}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="deviceInfo_Item">
|
||||||
|
<view class="deviceInfo_Item_ask">净水值</view>
|
||||||
|
<view class="deviceInfo_Item_con">{{Info.device_net.purification_water_value}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="deviceInfo_Item">
|
||||||
|
<view class="deviceInfo_Item_ask">计费模式</view>
|
||||||
|
<view class="deviceInfo_Item_con">{{Info.device_net.billing_mode}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="deviceInfo_Item">
|
||||||
|
<view class="deviceInfo_Item_ask">剩余流量</view>
|
||||||
|
<view class="deviceInfo_Item_con">{{Info.device.surplus_flow}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="deviceInfo_Item">
|
||||||
|
<view class="deviceInfo_Item_ask">货贷总价</view>
|
||||||
|
<view class="deviceInfo_Item_con">277天</view>
|
||||||
|
</view>
|
||||||
|
<view class="deviceInfo_Item">
|
||||||
|
<view class="deviceInfo_Item_ask">累计过滤流量</view>
|
||||||
|
<view class="deviceInfo_Item_con">{{Info.device.accumulated_usage}}升</view>
|
||||||
|
</view>
|
||||||
|
<view class="deviceInfo_Item">
|
||||||
|
<view class="deviceInfo_Item_ask">水质等级</view>
|
||||||
|
<view class="deviceInfo_Item_con">{{Info.device.purification_water_value}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="deviceInfo_Item">
|
||||||
|
<view class="deviceInfo_Item_ask">iccd</view>
|
||||||
|
<view class="deviceInfo_Item_con">{{Info.device.device_iccid}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="deviceInfo_Item">
|
||||||
|
<view class="deviceInfo_Item_ask">创建时间</view>
|
||||||
|
<view class="deviceInfo_Item_con">{{Info.device.create_time}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="btnList">
|
||||||
|
<!-- wx:if="{{Info.sevice_status == 2}} -->
|
||||||
|
<view class="btn btn1" bind:tap="Open" wx:if="{{Info.sevice_status == 2}}">开机</view>
|
||||||
|
<!-- wx:if="{{Info.sevice_status == 1}}" -->
|
||||||
|
<view class="btn btn2" bind:tap="Close" wx:if="{{Info.sevice_status == 1}}">关机</view>
|
||||||
|
<view class="btn btn2" bind:tap="uninstall">拆机</view>
|
||||||
|
<view class="btn btn3" bind:tap="active">激活</view>
|
||||||
|
<!-- -->
|
||||||
|
<view class="btn btn4" wx:if="{{Info.billing_method == 2}}" bind:tap="recharge2">流量充值</view>
|
||||||
|
<view class="btn btn4" wx:if="{{Info.billing_method == 1}}" bind:tap="recharge1">时长充值</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="gray"></view>
|
||||||
|
<view class="filter_Info">
|
||||||
|
<view class="deviceInfo_Tit">滤芯信息</view>
|
||||||
|
<view class="lifetime-progress" wx:for="{{Info.device_part}}">
|
||||||
|
<text class="progress-name">{{item.parts_name}}</text>
|
||||||
|
<van-progress percentage="{{item.parent}}" color="linear-gradient(to right, #FFBBAC, #2583FF)" stroke-width="10" show-pivot="{{false}}" track-color="#FFD6D6" />
|
||||||
|
<text class="progress">复位</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="gray"></view>
|
||||||
|
<view class="owner">
|
||||||
|
<view class="deviceInfo_Tit">机主信息</view>
|
||||||
|
<view class="deviceInfo_Item">
|
||||||
|
<view class="deviceInfo_Item_ask">姓名</view>
|
||||||
|
<view class="deviceInfo_Item_con">{{Info.device.customer_name}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="deviceInfo_Item">
|
||||||
|
<view class="deviceInfo_Item_ask">微信昵称</view>
|
||||||
|
<view class="deviceInfo_Item_con">{{Info.device.customer_name}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="deviceInfo_Item">
|
||||||
|
<view class="deviceInfo_Item_ask">手机号码</view>
|
||||||
|
<view class="deviceInfo_Item_con">{{Info.device.customer_phone}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="deviceInfo_Item">
|
||||||
|
<view class="deviceInfo_Item_ask">地址</view>
|
||||||
|
<view class="deviceInfo_Item_con">{{Info.device.region + Info.device.address}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- <cover-view style="position: fixed;">
|
||||||
|
<import src="/pages/public/footer.wxml" />
|
||||||
|
<template is="footer-nav" data="{{nav_list:nav_list,foot_width:foot_width}}" />
|
||||||
|
</cover-view> -->
|
||||||
|
|
||||||
|
<van-popup show="{{ show }}" position="bottom" safe-area-inset-bottom round bind:close="onClose">
|
||||||
|
<view class="tit">
|
||||||
|
<view class="cancel" bind:close="onClose">取消</view>
|
||||||
|
<view class="sub" bind:tap="createUninstall">确定</view>
|
||||||
|
</view>
|
||||||
|
<view class="row">
|
||||||
|
<view class="row_label">备注:</view>
|
||||||
|
<view class="row_con">
|
||||||
|
<textarea placeholder="请输入备注" bindinput="remarksIpt1"></textarea>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</van-popup>
|
||||||
|
|
||||||
|
|
||||||
|
<van-popup show="{{ show2 }}" position="bottom" safe-area-inset-bottom round bind:close="onClose">
|
||||||
|
<view class="tit">
|
||||||
|
<view class="cancel" bind:close="onClose">取消</view>
|
||||||
|
<view class="sub" bind:tap="deviceDeactivation">确定</view>
|
||||||
|
</view>
|
||||||
|
<view class="row">
|
||||||
|
<view class="row_label">到期日期:</view>
|
||||||
|
<view class="row_con">
|
||||||
|
<input type="number" bindinput="changeRemainingDay" placeholder="请输入到期日期 格式 20250508" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</van-popup>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<van-popup show="{{ show3 }}" position="bottom" safe-area-inset-bottom round bind:close="onClose">
|
||||||
|
<view class="tit">
|
||||||
|
<view class="cancel" bind:close="onClose">取消</view>
|
||||||
|
<view class="sub" bind:tap="deviceDataForce">确定</view>
|
||||||
|
</view>
|
||||||
|
<view class="row">
|
||||||
|
<view class="row_label">设置数额:</view>
|
||||||
|
<view class="row_con">
|
||||||
|
<textarea placeholder="请输入数额" bindinput="changeSurplusFlow"></textarea>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</van-popup>
|
||||||
@ -0,0 +1,214 @@
|
|||||||
|
page {}
|
||||||
|
|
||||||
|
/* 容器样式 */
|
||||||
|
.container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding-bottom: 200rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 滑动 Tab 栏样式 */
|
||||||
|
.tab-scroll {
|
||||||
|
white-space: nowrap;
|
||||||
|
/* 禁止换行 */
|
||||||
|
background-color: #f7f8fa;
|
||||||
|
padding: 10px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-item {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 10px 20px;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* 内容区域样式 */
|
||||||
|
.content-scroll {
|
||||||
|
white-space: nowrap;
|
||||||
|
/* 禁止换行 */
|
||||||
|
height: 300px;
|
||||||
|
/* 设置内容区域高度 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-item {
|
||||||
|
display: inline-block;
|
||||||
|
width: 100vw;
|
||||||
|
/* 每个内容项占满屏幕宽度 */
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 20px;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.tab-item.active {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #222222;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-item.active::after {
|
||||||
|
content: '';
|
||||||
|
width: 127rpx;
|
||||||
|
height: 10rpx;
|
||||||
|
background: #2583FF;
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
bottom: 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-item.active::before {
|
||||||
|
content: '';
|
||||||
|
width: 127rpx;
|
||||||
|
height: 10rpx;
|
||||||
|
background: #FF5D73;
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deviceInfo {
|
||||||
|
padding: 30rpx 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deviceInfo_Tit {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #222222;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deviceInfo_Item {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deviceInfo_Item_ask {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #999999;
|
||||||
|
margin-right: 30rpx;
|
||||||
|
min-width: 110rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deviceInfo_Item_con {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #222222;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btnList {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-top: 40rpx;
|
||||||
|
color: #fff;
|
||||||
|
justify-content: space-between;
|
||||||
|
/* padding: 0 82rpx; */
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
border-radius: 100rpx 100rpx 100rpx 100rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 10rpx 40rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn1 {
|
||||||
|
background: #2583FF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn2 {
|
||||||
|
background: #999999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn3 {
|
||||||
|
background: #D5AC66;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn4 {
|
||||||
|
background: #67C23A;
|
||||||
|
}
|
||||||
|
|
||||||
|
.filter_Info {
|
||||||
|
padding: 30rpx 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lifetime-progress {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress-name {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #999999;
|
||||||
|
width: 20%;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.van-progress {
|
||||||
|
width: 366rpx;
|
||||||
|
margin-right: 19rpx;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
width: 90rpx;
|
||||||
|
height: 36rpx;
|
||||||
|
background: #2583FF;
|
||||||
|
border-radius: 100rpx 100rpx 100rpx 100rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.owner {
|
||||||
|
padding: 30rpx 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row {
|
||||||
|
padding-top: 30rpx;
|
||||||
|
height: 300rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
overflow-y: auto;
|
||||||
|
padding: 30rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-size: 30rpx;
|
||||||
|
display: flex;
|
||||||
|
color: #606266;
|
||||||
|
}
|
||||||
|
.row_label{
|
||||||
|
margin-right: 20rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row_con{
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
.row_con textarea{
|
||||||
|
height: 100% !important;
|
||||||
|
}
|
||||||
|
.tit {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
font-size: 32rpx;
|
||||||
|
padding-right: 30rpx;
|
||||||
|
padding-left: 30rpx;
|
||||||
|
padding-top: 20rpx;
|
||||||
|
}
|
||||||
@ -1,77 +1,694 @@
|
|||||||
let util = require("../../../../../utils/util")
|
|
||||||
const apiArr = require('../../../../../api/water_filter')
|
|
||||||
|
|
||||||
// packages/WaterPurifier/pages/device/deviceDesc/deviceDesc.js
|
let util = require('../../../../../utils/util')
|
||||||
|
let apiArr = require('../../../../../api/water_filter')
|
||||||
|
import * as echarts from '../../../../../component/ec-canvas/echarts';
|
||||||
|
|
||||||
|
// packages/master/deviceInfo/index.js
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
progress_List: [{
|
id: "",
|
||||||
"name": "HXTH滤芯",
|
currentDevice: "",
|
||||||
"progress": 97.41
|
imagePath: "",
|
||||||
},
|
ec: {
|
||||||
{
|
onInit: initChart
|
||||||
"name": "RO膜滤芯",
|
|
||||||
"progress": 87.41
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "PP+CB滤芯",
|
|
||||||
"progress": 40.41
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "PP棉滤芯",
|
|
||||||
"progress": 90.41
|
|
||||||
}
|
|
||||||
],
|
|
||||||
device_id:"",
|
|
||||||
Info:{},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getInfo(){
|
appointment_time: "",
|
||||||
let that= this
|
show: false,
|
||||||
util.postUrl(apiArr.deviceDesc,{
|
show2: false,
|
||||||
device_id:Number(that.data.device_id)
|
show3: false,
|
||||||
},res=>{
|
show4: false,
|
||||||
|
show5: false,
|
||||||
|
show6: false,
|
||||||
|
remarks1: "", //拆机备注
|
||||||
|
remainingDays: "",//到期日期
|
||||||
|
surplusFlow: "",//剩余流量
|
||||||
|
remaining_days: "",//转时长
|
||||||
|
surplus_flow: "",//转流量
|
||||||
|
minDate: new Date().getTime(),
|
||||||
|
formatter(type, value) {
|
||||||
|
if (type === 'year') {
|
||||||
|
return `${value}年`;
|
||||||
|
}
|
||||||
|
if (type === 'month') {
|
||||||
|
return `${value}月`;
|
||||||
|
}
|
||||||
|
if (type === 'day') {
|
||||||
|
return `${value}日`;
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
onInput(event) {
|
||||||
|
let that = this
|
||||||
|
const date = new Date(event.detail); // 获取选中的 Date 对象
|
||||||
|
const year = date.getFullYear(); // 获取年份
|
||||||
|
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,所以需要+1
|
||||||
|
const day = String(date.getDate()).padStart(2, '0');
|
||||||
|
const hours = String(date.getHours()).padStart(2, '0'); // 小时补零
|
||||||
|
const minutes = String(date.getMinutes()).padStart(2, '0'); // 分钟补零
|
||||||
|
const time = `${year}-${month}-${day} ${hours}:${minutes}`;
|
||||||
|
that.setData({
|
||||||
|
appointment_time: time,
|
||||||
|
show: false
|
||||||
|
})
|
||||||
|
|
||||||
|
that.cancelActivation()
|
||||||
|
},
|
||||||
|
onClose() {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
show: false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
formatPercentage(value) {
|
||||||
|
return Math.max(0, Number((value || 0).toFixed(0)));
|
||||||
|
},
|
||||||
|
getInfo() {
|
||||||
|
let that = this
|
||||||
|
console.log(that, 'ssss');
|
||||||
|
util.postUrl(apiArr.deviceInfo, {
|
||||||
|
device_id: that.data.id
|
||||||
|
}, res => {
|
||||||
|
res.remainDay = Math.max(0, that.getDaysBetweenDates2(res.expiration_duration)) //剩余天数
|
||||||
|
if (res.expiration_duration) {
|
||||||
|
res.difDay = Math.max(0, that.getDaysBetweenDates(res.install_time)) //服务天数,确保不小于0
|
||||||
|
} else {
|
||||||
|
const installDate = new Date(res.install_time)
|
||||||
|
const expireDate = new Date(res.expiration_duration)
|
||||||
|
res.difDay = Math.max(0, Math.floor((expireDate - installDate) / (1000 * 60 * 60 * 24))) //确保不小于0
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res.device_part) {
|
||||||
|
res.device_part.forEach(item => {
|
||||||
|
item.difDay = that.getDaysBetweenDates(item.start_time)
|
||||||
|
const remainingDays = Math.max(0, (item.available_days || 0) - (item.difDay || 0));
|
||||||
|
|
||||||
|
item.percentageDay = that.formatPercentage(
|
||||||
|
(remainingDays / (item.available_days || 1)) * 100
|
||||||
|
);
|
||||||
|
item.percentageCapacity = that.formatPercentage(
|
||||||
|
(1 - (item.threshold_volume || 0) / (item.available_volume || 1)) * 100
|
||||||
|
);
|
||||||
|
})
|
||||||
|
|
||||||
|
const first = res.device_part.findIndex(item =>
|
||||||
|
item.parts_name.indexOf("PP棉滤芯") !== -1
|
||||||
|
);
|
||||||
|
if (first !== -1) {
|
||||||
|
const [removed] = res.device_part.splice(first, 1); // 移除该对象
|
||||||
|
res.device_part.unshift(removed); // 插入到首位
|
||||||
|
}
|
||||||
|
const Second = res.device_part.findIndex(item =>
|
||||||
|
item.parts_name.indexOf("PP+CB") !== -1
|
||||||
|
);
|
||||||
|
if (Second !== -1) {
|
||||||
|
const [removed] = res.device_part.splice(Second, 1); // 移除该对象
|
||||||
|
res.device_part.splice(1, 0, removed); // 插入到第二位
|
||||||
|
}
|
||||||
|
const Third = res.device_part.findIndex(item =>
|
||||||
|
item.parts_name.indexOf("RO") !== -1
|
||||||
|
);
|
||||||
|
if (Third !== -1) {
|
||||||
|
const [removed] = res.device_part.splice(Third, 1); // 移除该对象
|
||||||
|
res.device_part.splice(2, 0, removed); // 插入到第二位
|
||||||
|
}
|
||||||
|
const Fourth = res.device_part.findIndex(item =>
|
||||||
|
item.parts_name.indexOf("后置活性炭") !== -1
|
||||||
|
);
|
||||||
|
if (Fourth !== -1) {
|
||||||
|
const [removed] = res.device_part.splice(Fourth, 1); // 移除该对象
|
||||||
|
res.device_part.splice(3, 0, removed); // 插入到第二位
|
||||||
|
}
|
||||||
|
}
|
||||||
|
res.today = Number(res.today).toFixed(2)
|
||||||
|
res.yesterday = Number(res.yesterday).toFixed(2)
|
||||||
|
|
||||||
|
that.setData({
|
||||||
|
currentDevice: res
|
||||||
|
})
|
||||||
|
let Xarr = [];
|
||||||
|
let Yarr = [];
|
||||||
|
res.device_net.forEach(item => {
|
||||||
|
Xarr.push(item.create_time.slice(11, 16))
|
||||||
|
Yarr.push((item.cumulative_filtration_flow).toFixed(1))
|
||||||
|
})
|
||||||
|
that.updateChart({
|
||||||
|
xAxis: Xarr,
|
||||||
|
series: Yarr
|
||||||
|
})
|
||||||
|
that.getDeriveInfo()
|
||||||
|
setTimeout(() => {
|
||||||
|
const ecComponent = that.selectComponent("#mychart-dom-bar")
|
||||||
|
// 将 canvas 内容转换为临时图片文件
|
||||||
|
ecComponent.canvasToTempFilePath({
|
||||||
|
// canvasId: 'mychart-dom-bar',
|
||||||
|
success: (result) => {
|
||||||
|
that.base64({
|
||||||
|
url: result.tempFilePath,
|
||||||
|
type: 'png',
|
||||||
|
}).then((res) => {
|
||||||
|
that.setData({
|
||||||
|
imagePath: res
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.error('转换失败:', err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, 2000)
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
replay(e) {
|
||||||
|
wx.showLoading({
|
||||||
|
title: '重置中...',
|
||||||
|
})
|
||||||
|
util.postUrl4(apiArr.resetFilter, {
|
||||||
|
part_id: e.currentTarget.dataset.item.id,
|
||||||
|
device_id: e.currentTarget.dataset.item.device_id,
|
||||||
|
}, res => {
|
||||||
|
wx.hideLoading()
|
||||||
console.log(res);
|
console.log(res);
|
||||||
res.device_part.forEach(item=>{
|
if (res.msg == '操作成功') {
|
||||||
item.shengyuTime = that.getDaysDifference(item.expiration_time)
|
wx.showToast({
|
||||||
item.parent = Math.round((Number(item.shengyuTime) / Number(item.availableDays)*100))
|
title: '重置成功!',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
that.getfilterList()
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
//查询设备实时信息
|
||||||
|
getDeriveInfo() {
|
||||||
|
let that = this
|
||||||
|
util.postUrl4(apiArr.boardInfo, {
|
||||||
|
device_id: that.data.currentDevice.device_id
|
||||||
|
}, res => {
|
||||||
|
console.log(res);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
///////////////////////////////////////////////新增/////////////////////////////////////////////////////////////////////////
|
||||||
|
onClose2() {
|
||||||
|
this.setData({
|
||||||
|
show2: false,
|
||||||
|
show3: false,
|
||||||
|
show4: false,
|
||||||
|
show5: false,
|
||||||
|
show6: false,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 拆机
|
||||||
|
uninstall() {
|
||||||
|
let that = this
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '请确保设备通电开机状态,该操作将取消设备激活状态',
|
||||||
|
complete: (res) => {
|
||||||
|
if (res.cancel) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res.confirm) {
|
||||||
|
that.setData({
|
||||||
|
show2: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
remarksIpt1(e) {
|
||||||
|
console.log(e);
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
remarks1: e.detail.value
|
||||||
|
})
|
||||||
|
},
|
||||||
|
createUninstall() {
|
||||||
|
wx.showLoading({
|
||||||
|
title: '加载中...',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
let that = this
|
||||||
|
util.postUrl(apiArr.createUninstallOrder, {
|
||||||
|
device_id: that.data.currentDevice.device_id,
|
||||||
|
info_id:wx.getStorageSync('info_id'),
|
||||||
|
remark: that.data.remarks1
|
||||||
|
}, res => {
|
||||||
|
console.log(res);
|
||||||
|
wx.hideLoading()
|
||||||
|
wx.showToast({
|
||||||
|
title: '拆机工单创建完成',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/packages/master/order/index?type=3',
|
||||||
|
})
|
||||||
|
}, 1500)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 激活
|
||||||
|
active() {
|
||||||
|
wx.showLoading({
|
||||||
|
title: '加载中...',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
let that = this
|
||||||
|
util.postUrl4(apiArr.deviceActive, {
|
||||||
|
device_id: that.data.currentDevice.device_id
|
||||||
|
}, res => {
|
||||||
|
console.log(res);
|
||||||
|
wx.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
that.getInfo()
|
||||||
|
wx.hideLoading()
|
||||||
|
|
||||||
|
return
|
||||||
|
if (res.statusCode == 200) {
|
||||||
|
wx.showToast({
|
||||||
|
title: '激活成功',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
that.getInfo()
|
||||||
|
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: res.data.msg,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
wx.hideLoading()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
isPureNumber(value) {
|
||||||
|
return /^\d+(\.\d+)?$/.test(value);
|
||||||
|
},
|
||||||
|
//时长充值
|
||||||
|
recharge1() {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
show4: true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
deviceDeactivation() {
|
||||||
|
let that = this
|
||||||
|
if (!that.isPureNumber(that.data.remainingDays)) {
|
||||||
|
return wx.showToast({
|
||||||
|
title: '请输入正确到期日期',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '确定要充值时长吗?请在设备通电开机的状态下进行操作',
|
||||||
|
complete: (res) => {
|
||||||
|
if (res.cancel) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res.confirm) {
|
||||||
|
wx.showLoading({
|
||||||
|
title: '加载中...',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
util.postUrl4(apiArr.deviceDeactivation, {
|
||||||
|
device_id: that.data.currentDevice.device_id,
|
||||||
|
remainingDays: that.data.remainingDays
|
||||||
|
}, res => {
|
||||||
|
wx.hideLoading()
|
||||||
|
if (res.data.code == 200) {
|
||||||
|
wx.showToast({
|
||||||
|
title: '充值成功',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
that.getInfo()
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: res.data.msg,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
that.setData({
|
||||||
|
show4: false,
|
||||||
|
remainingDays: ""
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeRemainingDay(e) {
|
||||||
|
console.log(e);
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
remainingDays: e.detail.value
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//流量充值
|
||||||
|
recharge2() {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
show3: true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeSurplusFlow(e) {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
surplusFlow: e.detail.value
|
||||||
|
})
|
||||||
|
},
|
||||||
|
deviceDataForce() {
|
||||||
|
let that = this
|
||||||
|
if (!that.isPureNumber(that.data.surplusFlow)) {
|
||||||
|
return wx.showToast({
|
||||||
|
title: '请输入正确数额',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '确定要充值流量吗?请在设备通电开机的状态下进行操作',
|
||||||
|
complete: (res) => {
|
||||||
|
if (res.cancel) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res.confirm) {
|
||||||
|
util.postUrl4(apiArr.deviceDataForce, {
|
||||||
|
device_id: that.data.currentDevice.device_id,
|
||||||
|
surplusFlow: that.data.surplusFlow
|
||||||
|
}, res => {
|
||||||
|
if (res.data.code == 200) {
|
||||||
|
wx.showToast({
|
||||||
|
title: '充值成功',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
that.getInfo()
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: res.data.msg,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
that.setData({
|
||||||
|
show3: false,
|
||||||
|
surplusFlow: ""
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//转时长
|
||||||
|
timeSet() {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
show5: true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeRemainingDay2(e) {
|
||||||
|
console.log(e);
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
remaining_days: e.detail.value
|
||||||
|
})
|
||||||
|
},
|
||||||
|
modeToTime() {
|
||||||
|
let that = this
|
||||||
|
if (!that.data.remaining_days) {
|
||||||
|
return wx.showToast({
|
||||||
|
title: '请输入到期日期',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '确定要将设备转时长吗?请在设备通电开机的状态下进行操作',
|
||||||
|
complete: (res) => {
|
||||||
|
if (res.cancel) {
|
||||||
|
}
|
||||||
|
if (res.confirm) {
|
||||||
|
util.postUrl4(apiArr.deviceToTime, {
|
||||||
|
device_id: that.data.currentDevice.device_id,
|
||||||
|
remaining_days: that.data.remaining_days
|
||||||
|
}, res => {
|
||||||
|
if (res.data.code == 200) {
|
||||||
|
wx.showToast({
|
||||||
|
title: '充值成功',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
that.getInfo()
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: res.data.msg,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
that.setData({
|
||||||
|
show5: false,
|
||||||
|
remaining_days: ""
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 转流量
|
||||||
|
timeSet2() {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
show6: true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeRemainingDay3(e) {
|
||||||
|
console.log(e);
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
surplus_flow: e.detail.value
|
||||||
|
})
|
||||||
|
},
|
||||||
|
modeToFlowRate() {
|
||||||
|
let that = this
|
||||||
|
if (!that.data.surplus_flow) {
|
||||||
|
return wx.showToast({
|
||||||
|
title: '请输入数额',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '确定要设备转流量吗?请在设备通电开机的状态下进行操作',
|
||||||
|
complete: (res) => {
|
||||||
|
if (res.cancel) {
|
||||||
|
}
|
||||||
|
if (res.confirm) {
|
||||||
|
util.postUrl4(apiArr.deviceToTraffic, {
|
||||||
|
device_id: that.data.currentDevice.device_id,
|
||||||
|
surplus_flow: that.data.surplus_flow
|
||||||
|
}, res => {
|
||||||
|
if (res.data.code == 200) {
|
||||||
|
wx.showToast({
|
||||||
|
title: '充值成功',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
that.getInfo()
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: res.data.msg,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
that.setData({
|
||||||
|
show6: false,
|
||||||
|
surplus_flow: ""
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
// 转零售
|
||||||
|
retailSet() {
|
||||||
|
let that = this
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '是否确认设置为零售模式?此操作请在设备通电开机的状态下进行操作',
|
||||||
|
complete: (res) => {
|
||||||
|
if (res.cancel) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res.confirm) {
|
||||||
|
util.postUrl4(apiArr.deviceToRetail, {
|
||||||
|
device_id: that.data.currentDevice.device_id
|
||||||
|
}, res => {
|
||||||
|
if (res.data.code == 200) {
|
||||||
|
wx.showToast({
|
||||||
|
title: '设置成功',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
that.getInfo()
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: res.data.msg,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
///////////////////////////////////////////////新增/////////////////////////////////////////////////////////////////////////
|
||||||
|
//开关机
|
||||||
|
openOff() {
|
||||||
|
let that = this
|
||||||
|
let onOff = ''
|
||||||
|
|
||||||
|
if (that.data.currentDevice.sevice_status == 1) {
|
||||||
|
onOff = 2
|
||||||
|
} else if (that.data.currentDevice.sevice_status == 2) {
|
||||||
|
onOff = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
wx.showLoading({
|
||||||
|
title: '操作中...',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
|
||||||
|
util.postUrl(apiArr.openOff, {
|
||||||
|
deviceId: that.data.currentDevice.device_id,
|
||||||
|
onOff
|
||||||
|
}, res => {
|
||||||
|
wx.hideLoading()
|
||||||
|
console.log(res);
|
||||||
|
if (res.msg == '操作成功') {
|
||||||
|
if (res.data.params.sevice_status.value == '00') {
|
||||||
|
wx.hideLoading()
|
||||||
|
wx.showToast({
|
||||||
|
title: '关机成功!',
|
||||||
|
icon: "none"
|
||||||
})
|
})
|
||||||
that.setData({
|
that.setData({
|
||||||
Info:res
|
"currentDevice.sevice_status": 2
|
||||||
})
|
})
|
||||||
|
console.log('关机');
|
||||||
|
} else if (res.data.params.sevice_status.value == '10') {
|
||||||
|
wx.hideLoading()
|
||||||
|
wx.showToast({
|
||||||
|
title: '开机成功!',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
that.setData({
|
||||||
|
"currentDevice.sevice_status": 1
|
||||||
|
})
|
||||||
|
console.log('开机');
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
getDaysDifference(targetDate) {
|
updateChart(data) {
|
||||||
// 获取当前时间
|
const ecComponent = this.selectComponent("#mychart-dom-bar");
|
||||||
const now = new Date();
|
if (!ecComponent) return;
|
||||||
// 将传递的时间转换为日期对象
|
|
||||||
|
this.setData({
|
||||||
|
chartData: data
|
||||||
|
});
|
||||||
|
|
||||||
|
ecComponent.init((canvas, width, height, dpr) => {
|
||||||
|
const chart = initChart(canvas, width, height, dpr);
|
||||||
|
chart.setOption({
|
||||||
|
grid: {
|
||||||
|
left: '3%', // 左边距
|
||||||
|
right: '4%', // 右边距
|
||||||
|
bottom: '3%', // 底部边距
|
||||||
|
containLabel: true // 确保标签包含在内
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
data: data.xAxis
|
||||||
|
},
|
||||||
|
series: [{
|
||||||
|
data: data.series,
|
||||||
|
label: { // 添加这个label配置
|
||||||
|
show: true, // 开启显示
|
||||||
|
position: 'top', // 位置在柱子上方
|
||||||
|
color: '#333', // 文字颜色
|
||||||
|
// fontSize: 8 // 文字大小
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
return chart;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
base64({ url, type }) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
wx.getFileSystemManager().readFile({
|
||||||
|
filePath: url, //选择图片返回的相对路径
|
||||||
|
encoding: 'base64', //编码格式
|
||||||
|
success: res => {
|
||||||
|
resolve('data:image/' + type.toLocaleLowerCase() + ';base64,' + res.data)
|
||||||
|
},
|
||||||
|
fail: res => reject(res.errMsg)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
convertCanvasToImage() {
|
||||||
|
wx.canvasToTempFilePath({
|
||||||
|
canvasId: 'myChart',
|
||||||
|
success: (res) => {
|
||||||
|
console.log(res.tempFilePath);
|
||||||
|
this.setData({
|
||||||
|
imagePath: res.tempFilePath
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.error('Canvas to image failed:', err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getDaysBetweenDates(inputDate) {
|
||||||
|
const currentDate = new Date();
|
||||||
|
// 将传入的日期字符串转换为日期对象
|
||||||
|
const targetDate = new Date(inputDate);
|
||||||
|
// 计算两个日期之间的时间差(以毫秒为单位)
|
||||||
|
const timeDifference = currentDate - targetDate;
|
||||||
|
// 将时间差转换为天数
|
||||||
|
const daysDifference = Math.floor(timeDifference / (1000 * 60 * 60 * 24));
|
||||||
|
// 返回天数
|
||||||
|
return daysDifference;
|
||||||
|
},
|
||||||
|
getDaysBetweenDates2(targetDate) {
|
||||||
|
// 获取当前日期(不含时间)
|
||||||
|
const today = new Date();
|
||||||
|
today.setHours(0, 0, 0, 0); // 时间归零,避免时间差影响
|
||||||
|
// 解析目标日期(格式:YYYY-MM-DD)
|
||||||
const target = new Date(targetDate);
|
const target = new Date(targetDate);
|
||||||
// 计算时间差(以毫秒为单位)
|
target.setHours(0, 0, 0, 0);
|
||||||
const timeDiff = target.getTime() - now.getTime();
|
// 计算毫秒差并转换为天数
|
||||||
// 将毫秒转换为天数
|
const timeDiff = target - today;
|
||||||
const daysDiff = Math.ceil(timeDiff / (1000 * 60 * 60 * 24));
|
const daysRemaining = Math.ceil(timeDiff / (1000 * 60 * 60 * 24));
|
||||||
return daysDiff;
|
return daysRemaining;
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
//开机
|
|
||||||
Open(){
|
|
||||||
let that = this
|
|
||||||
util.postUrl(apiArr)
|
|
||||||
},
|
|
||||||
//关机
|
|
||||||
Close(){
|
|
||||||
let that = this
|
|
||||||
util.postUrl(apiArr)
|
|
||||||
},
|
|
||||||
// 强冲
|
|
||||||
QC(){
|
|
||||||
let that = this
|
|
||||||
util.postUrl(apiArr)
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -79,9 +696,8 @@ Page({
|
|||||||
*/
|
*/
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
let that = this
|
let that = this
|
||||||
console.log(options);
|
|
||||||
that.setData({
|
that.setData({
|
||||||
device_id:options.device_id
|
id: options.device_id
|
||||||
})
|
})
|
||||||
that.getInfo()
|
that.getInfo()
|
||||||
},
|
},
|
||||||
@ -90,7 +706,10 @@ Page({
|
|||||||
* 生命周期函数--监听页面初次渲染完成
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
*/
|
*/
|
||||||
onReady() {
|
onReady() {
|
||||||
|
let that = this
|
||||||
|
setTimeout(() => {
|
||||||
|
this.convertCanvasToImage()
|
||||||
|
}, 5000)
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -135,3 +754,49 @@ Page({
|
|||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
function initChart(canvas, width, height, dpr) {
|
||||||
|
const chart = echarts.init(canvas, null, {
|
||||||
|
width: width,
|
||||||
|
height: height,
|
||||||
|
devicePixelRatio: dpr // 将此选项设置为 2,可以在高分辨率屏幕上绘制更清晰的图表
|
||||||
|
});
|
||||||
|
canvas.setChart(chart);
|
||||||
|
const option = {
|
||||||
|
xAxis: {
|
||||||
|
type: 'category',
|
||||||
|
// data: ['16:41', '22:41', '04:41', '10:41', '16:41'],
|
||||||
|
data: []
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
type: 'value',
|
||||||
|
// data: ['0ml', '560ml']
|
||||||
|
min: 0,
|
||||||
|
axisLabel: {
|
||||||
|
formatter: '{value}ml'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
series: [{
|
||||||
|
// data: [150, 230, 224, 218, 135, 147, 345],
|
||||||
|
data: [],
|
||||||
|
type: 'bar',
|
||||||
|
barWidth: 15,
|
||||||
|
itemStyle: { //柱状颜色和圆角
|
||||||
|
color: {
|
||||||
|
x: 0,
|
||||||
|
y: 1,
|
||||||
|
colorStops: [{
|
||||||
|
offset: 0,
|
||||||
|
color: '#FFBBAC',
|
||||||
|
}, {
|
||||||
|
offset: 1,
|
||||||
|
color: '#338BFF'
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
barBorderRadius: [5, 5, 0, 0], // (顺时针左上,右上,右下,左下)
|
||||||
|
},
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
chart.setOption(option);
|
||||||
|
return chart;
|
||||||
|
}
|
||||||
@ -1,4 +1,6 @@
|
|||||||
{
|
{
|
||||||
"usingComponents": {},
|
"usingComponents": {
|
||||||
|
"ec-canvas": "/component/ec-canvas/ec-canvas"
|
||||||
|
},
|
||||||
"navigationBarTitleText": "设备详情"
|
"navigationBarTitleText": "设备详情"
|
||||||
}
|
}
|
||||||
@ -1,97 +1,209 @@
|
|||||||
<view class="container">
|
<!--pages/water_filter/water_filter.wxml-->
|
||||||
<!-- 滑动 Tab 栏 -->
|
<!-- 人人爱净水页面 -->
|
||||||
<!-- <scroll-view scroll-x scroll-with-animation scroll-into-view="{{ currentTabId }}" class="tab-scroll">
|
<view class="water-filter">
|
||||||
<view wx:for="{{ tabs }}" wx:key="index" id="tab{{ index }}" class="tab-item {{ currentTab === index ? 'active' : '' }}" bindtap="switchTab" data-index="{{ index }}">
|
<view class="top" style="background-image: url('https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/Group_401.png?v1'); background-size: 100% 100%; height: 698rpx; width: 100%;">
|
||||||
{{ item }}
|
<!-- 位置定位 -->
|
||||||
|
<view class="positioning">
|
||||||
|
<view class="positioning-left">
|
||||||
|
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/Group 38.png" mode="" class="positioning-icon-left" />
|
||||||
|
<text class="positioning-text">{{currentDevice.region + currentDevice.address}}</text>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view> -->
|
</view>
|
||||||
|
<!-- 净化前后数值 -->
|
||||||
|
<view class="purification-value">
|
||||||
<view class="deviceInfo">
|
<view class="purification-value-left">
|
||||||
<view class="deviceInfo_Tit">设备编号:{{Info.device.device_code}}</view>
|
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/Group_420.png?v1" mode="" class="purification-value-icon" />
|
||||||
<view class="deviceInfo_Item">
|
<view class="purification-value-text">
|
||||||
<view class="deviceInfo_Item_ask">设备型号</view>
|
<text class="front puri-text">净化前</text>
|
||||||
<view class="deviceInfo_Item_con">{{Info.device.product_name}}</view>
|
<text class="tds puri-text">水质TDS值</text>
|
||||||
|
<text class="tds-value puri-text">{{currentDevice.raw_water_value}}</text>
|
||||||
|
<text class="ppm puri-text">PPM</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="deviceInfo_Item">
|
|
||||||
<view class="deviceInfo_Item_ask">设备状态</view>
|
|
||||||
<view class="deviceInfo_Item_con">{{Info.device_net.active_status}}</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="deviceInfo_Item">
|
<view class="purification-value-left purification-value-right">
|
||||||
<view class="deviceInfo_Item_ask">原水值</view>
|
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/Group_420.png?v1" mode="" class="purification-value-icon" />
|
||||||
<view class="deviceInfo_Item_con">{{Info.device_net.raw_water_value}}</view>
|
<view class="purification-value-text">
|
||||||
|
<text class="front puri-text">净化后</text>
|
||||||
|
<text class="tds puri-text">水质TDS值</text>
|
||||||
|
<text class="tds-value puri-text">{{currentDevice.purification_water_value}}</text>
|
||||||
|
<text class="ppm puri-text">PPM</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="deviceInfo_Item">
|
|
||||||
<view class="deviceInfo_Item_ask">净水值</view>
|
|
||||||
<view class="deviceInfo_Item_con">{{Info.device_net.purification_water_value}}</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="deviceInfo_Item">
|
|
||||||
<view class="deviceInfo_Item_ask">计费模式</view>
|
|
||||||
<view class="deviceInfo_Item_con">{{Info.device_net.billing_mode}}</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="deviceInfo_Item">
|
<!-- 净化前后水质 -->
|
||||||
<view class="deviceInfo_Item_ask">剩余流量</view>
|
<view class="water-quality">
|
||||||
<view class="deviceInfo_Item_con">{{Info.device.surplus_flow}}</view>
|
<view class="water-quality-left">
|
||||||
|
<text class="water-quality-text" wx:if="{{ currentDevice.raw_water_value < 20 }}">净化前水质:极好</text>
|
||||||
|
<text class="water-quality-text" wx:if="{{currentDevice.raw_water_value >= 20 && currentDevice.raw_water_value < 50 }}">净化前水质:良好</text>
|
||||||
|
<text class="water-quality-text" wx:if="{{ currentDevice.raw_water_value >= 50 && currentDevice.raw_water_value < 150 }}">净化前水质:正常</text>
|
||||||
|
<text class="water-quality-text" wx:if="{{currentDevice.raw_water_value >= 150 && currentDevice.raw_water_value < 300 }}">净化前水质:较差</text>
|
||||||
|
<text class="water-quality-text" wx:if="{{ currentDevice.raw_water_value >= 300 }}">净化前水质:极差</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="deviceInfo_Item">
|
<view class="water-quality-right water-quality-left" style="margin-left: 60rpx;">
|
||||||
<view class="deviceInfo_Item_ask">货贷总价</view>
|
<text class="water-quality-text" wx:if="{{ currentDevice.purification_water_value < 20 }}">净化后水质:极好</text>
|
||||||
<view class="deviceInfo_Item_con">277天</view>
|
<text class="water-quality-text" wx:if="{{currentDevice.purification_water_value >= 20 && currentDevice.purification_water_value < 50 }}">净化后水质:良好</text>
|
||||||
|
<text class="water-quality-text" wx:if="{{ currentDevice.purification_water_value >= 50 && currentDevice.purification_water_value < 150 }}">净化后水质:正常</text>
|
||||||
|
<text class="water-quality-text" wx:if="{{currentDevice.purification_water_value >= 150 && currentDevice.purification_water_value < 300 }}">净化后水质:较差</text>
|
||||||
|
<text class="water-quality-text" wx:if="{{ currentDevice.purification_water_value >= 300 }}">净化后水质:极差</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="deviceInfo_Item">
|
|
||||||
<view class="deviceInfo_Item_ask">累计过滤流量</view>
|
|
||||||
<view class="deviceInfo_Item_con">{{Info.device.accumulated_usage}}升</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="deviceInfo_Item">
|
|
||||||
<view class="deviceInfo_Item_ask">水质等级</view>
|
|
||||||
<view class="deviceInfo_Item_con">{{Info.device.purification_water_value}}</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="deviceInfo_Item">
|
|
||||||
<view class="deviceInfo_Item_ask">iccd</view>
|
<view>
|
||||||
<view class="deviceInfo_Item_con">{{Info.device.device_iccid}}</view>
|
<!-- 我的设备信息 -->
|
||||||
|
<view class="my-device">
|
||||||
|
<!-- <text class="mydevice text-color">我的设备</text> -->
|
||||||
|
<view class="device-info">
|
||||||
|
<text class="mydevice text-color">我的设备</text>
|
||||||
|
<view class="info-top">
|
||||||
|
<view class="device-name">{{currentDevice.product_name}}</view>
|
||||||
|
|
||||||
|
<view class="device-state">
|
||||||
|
<image wx:if="{{currentDevice.sevice_status == '2'}}" bind:tap="openOff" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/Group_405.png?v1" mode="" class="switch-icon" />
|
||||||
|
<image wx:if="{{currentDevice.sevice_status == '1'}}" bind:tap="openOff" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/openBtn.png" mode="" class="switch-icon" />
|
||||||
|
<text class="switch-text text-color text-size" bind:tap="openOff" wx:if="{{currentDevice.sevice_status == '1'}}">开机</text>
|
||||||
|
<text class="switch-text text-color text-size" bind:tap="openOff" wx:if="{{currentDevice.sevice_status == '2'}}">关机</text>
|
||||||
|
<text class="switch-text text-color text-size" wx:if="{{currentDevice.sevice_status == '3'}}">制水故障</text>
|
||||||
|
<text class="switch-text text-color text-size" wx:if="{{currentDevice.sevice_status == '4'}}">漏水故障</text>
|
||||||
|
<text class="switch-text text-color text-size" wx:if="{{currentDevice.sevice_status == '5'}}">主板故障</text>
|
||||||
|
|
||||||
|
|
||||||
|
<image wx:if="{{currentDevice.network_status != '1'}}" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/mdicon3.png" mode="" class="wifi-icon" />
|
||||||
|
<image wx:if="{{currentDevice.network_status == 1}}" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/mdicon4.png" mode="" class="wifi-icon" />
|
||||||
|
<text class="wifi-text text-color text-size">{{currentDevice.network_status == '1'?'在线':'离线'}}</text>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="deviceInfo_Item">
|
|
||||||
<view class="deviceInfo_Item_ask">创建时间</view>
|
|
||||||
<view class="deviceInfo_Item_con">{{Info.device.create_time}}</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="btnList">
|
<view class="info-bottom">
|
||||||
<view class="btn btn1" bind:tap="Open">开机</view>
|
<view class="device-id text-size">
|
||||||
<view class="btn btn2" bind:tap="Close">关机</view>
|
编号:{{currentDevice.device_code}}
|
||||||
<view class="btn btn3" bind:tap="QC">强冲</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
<view class="service-day text-size text-color" wx:if="{{currentDevice.expiration_duration}}">
|
||||||
<view class="gray"></view>
|
已服务<span class="day-num">{{currentDevice.difDay}}</span><span class="day text-size">天</span>
|
||||||
<view class="filter_Info">
|
|
||||||
<view class="deviceInfo_Tit">滤芯信息</view>
|
|
||||||
<view class="lifetime-progress" wx:for="{{Info.device_part}}">
|
|
||||||
<text class="progress-name">{{item.parts_name}}</text>
|
|
||||||
<van-progress percentage="{{item.parent}}" color="linear-gradient(to right, #FFBBAC, #2583FF)" stroke-width="10" show-pivot="{{false}}" track-color="#FFD6D6" />
|
|
||||||
<text class="progress">复位</text>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
|
||||||
<view class="gray"></view>
|
<view class="service-day text-size text-color" wx:if="{{!currentDevice.expiration_duration}}">
|
||||||
<view class="owner">
|
已服务<span class="day-num">0</span><span class="day text-size">天</span>
|
||||||
<view class="deviceInfo_Tit">机主信息</view>
|
|
||||||
<view class="deviceInfo_Item">
|
|
||||||
<view class="deviceInfo_Item_ask">姓名</view>
|
|
||||||
<view class="deviceInfo_Item_con">{{Info.device.customer_name}}</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="deviceInfo_Item">
|
|
||||||
<view class="deviceInfo_Item_ask">微信昵称</view>
|
|
||||||
<view class="deviceInfo_Item_con">{{Info.device.customer_name}}</view>
|
<view wx:if="{{currentDevice.expiration_duration}}">
|
||||||
|
<view class="service-day text-size text-color" wx:if="{{currentDevice.status != 8}}">
|
||||||
|
剩余天数
|
||||||
|
<span class="day-num2">{{ currentDevice.remainDay}}</span>
|
||||||
|
<span class="day text-size">天</span>
|
||||||
</view>
|
</view>
|
||||||
<view class="deviceInfo_Item">
|
|
||||||
<view class="deviceInfo_Item_ask">手机号码</view>
|
<view class="service-day text-size text-color" wx:if="{{ currentDevice.status == 8}}">
|
||||||
<view class="deviceInfo_Item_con">{{Info.device.customer_phone}}</view>
|
<span class="day text-size">已欠费</span>
|
||||||
</view>
|
</view>
|
||||||
<view class="deviceInfo_Item">
|
|
||||||
<view class="deviceInfo_Item_ask">地址</view>
|
|
||||||
<view class="deviceInfo_Item_con">{{Info.device.region + Info.device.address}}</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
|
||||||
|
<view wx:if="{{!currentDevice.expiration_duration}}">
|
||||||
|
<view class="service-day text-size text-color" wx:if="{{ currentDevice.status != 1 && currentDevice.status != 8}}">
|
||||||
|
剩余天数
|
||||||
|
<span class="day-num2">0</span>
|
||||||
|
<span class="day text-size">天</span>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<van-divider />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 滤芯寿命 -->
|
||||||
|
<view class="lifetime">
|
||||||
|
<view class="lifetime-title">滤芯寿命</view>
|
||||||
|
<view class="lifetime-prompt">滤芯寿命用水量和使用时间来综合计算</view>
|
||||||
|
|
||||||
|
<view>
|
||||||
|
<view wx:for="{{currentDevice.device_part}}" wx:key="index">
|
||||||
|
|
||||||
|
<view class="progress-name">
|
||||||
|
<view>{{item.parts_name}}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="lifetime-progress">
|
||||||
|
<view style="display: flex;flex: 1;" wx:if="{{currentDevice.billing_method == 1}}">
|
||||||
|
<van-progress style="width: 100%;" percentage="{{item.percentageDay}}" color="linear-gradient(to right, #FFBBAC, #338BFF)" stroke-width="10" show-pivot="{{false}}" track-color="#F1F1F1" />
|
||||||
|
<text class="progress">{{item.percentageDay}}%</text>
|
||||||
|
</view>
|
||||||
|
<view style="display: flex;flex: 1;" wx:if="{{currentDevice.billing_method == 2}}">
|
||||||
|
<van-progress style="width: 100%;" percentage="{{item.percentageCapacity}}" color="linear-gradient(to right, #FFBBAC, #338BFF)" stroke-width="10" show-pivot="{{false}}" track-color="#F1F1F1" />
|
||||||
|
<text class="progress">{{item.percentageCapacity}}%</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view style="display: flex;flex: 1;" wx:if="{{currentDevice.billing_method == 3}}">
|
||||||
|
<van-progress style="width: 100%;" percentage="{{item.percentageDay}}" color="linear-gradient(to right, #FFBBAC, #338BFF)" stroke-width="10" show-pivot="{{false}}" track-color="#F1F1F1" />
|
||||||
|
<text class="progress">{{item.percentageDay}}%</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<view class="replayBtn" bind:tap="replay" data-item="{{item}}" wx:if="{{currentDevice.billing_method != 3}}">
|
||||||
|
重置
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<!-- 用水量 -->
|
||||||
|
<view class="water-consumption">
|
||||||
|
<view class="water-consumption-title">用水量</view>
|
||||||
|
<!-- 用水量统计 -->
|
||||||
|
|
||||||
|
<view class="water-consumption-row">
|
||||||
|
<view class="water-consumption-col">
|
||||||
|
<view class="water-consumption-col-name">累计用水量</view>
|
||||||
|
<view class="water-consumption-col-num">{{currentDevice.cumulative_filtration_flow}}<span class="water-consumption-col-num-size">L</span></view>
|
||||||
|
</view>
|
||||||
|
<view class="water-consumption-col col2">
|
||||||
|
<view class="water-consumption-col-name">今日用水量</view>
|
||||||
|
<view class="water-consumption-col-num">{{currentDevice.today}}<span class="water-consumption-col-num-size">L</span></view>
|
||||||
|
</view>
|
||||||
|
<view class="water-consumption-col col3">
|
||||||
|
<view class="water-consumption-col-name">昨日用水量</view>
|
||||||
|
<view class="water-consumption-col-num">{{currentDevice.yesterday}}<span class="water-consumption-col-num-size">L</span></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 用水量柱状图 -->
|
||||||
|
<view class="container">
|
||||||
|
<ec-canvas id="mychart-dom-bar" canvasId="mychart-dom-bar" type="2d" ec="{{ ec }}" ec="{{ ec }}"></ec-canvas>
|
||||||
|
<image src="{{imagePath}}" style="width: 100%;height:600rpx;"></image>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- <cover-view style="position: fixed;">
|
|
||||||
<import src="/pages/public/footer.wxml" />
|
<view class="deleteBtn" bind:tap="uninstall" wx:if="{{currentDevice.status == 1 || currentDevice.status == 3 || currentDevice.status == 5 || currentDevice.status == 6 || currentDevice.status == 8}}">
|
||||||
<template is="footer-nav" data="{{nav_list:nav_list,foot_width:foot_width}}" />
|
拆机
|
||||||
</cover-view> -->
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<van-popup show="{{ show }}" safe-area-inset-bottom lock-scroll bind:close="onClose" round close-on-click-overlay position="bottom">
|
||||||
|
<van-datetime-picker bind:cancel="onClose" formatter="{{ formatter }}" type="datetime" min-date="{{ minDate }}" bind:confirm="onInput" />
|
||||||
|
</van-popup>
|
||||||
|
|
||||||
|
<!-- 拆机 -->
|
||||||
|
<van-popup show="{{ show2 }}" position="bottom" safe-area-inset-bottom round bind:close="onClose2">
|
||||||
|
<view class="tit">
|
||||||
|
<view class="cancel" bind:close="onClose2">取消</view>
|
||||||
|
<view class="sub" bind:tap="createUninstall">确定</view>
|
||||||
|
</view>
|
||||||
|
<view class="row">
|
||||||
|
<view class="row_label">备注:</view>
|
||||||
|
<view class="row_con">
|
||||||
|
<textarea placeholder="请输入备注" bindinput="remarksIpt1"></textarea>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</van-popup>
|
||||||
|
|
||||||
|
|||||||
@ -1,180 +1,741 @@
|
|||||||
page{
|
.nav-box {
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 100%;
|
||||||
|
position: relative;
|
||||||
|
/* position: fixed; */
|
||||||
|
z-index: 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 容器样式 */
|
.nav-box .nav-bar {
|
||||||
.container {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
align-items: center;
|
||||||
padding-bottom: 200rpx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 滑动 Tab 栏样式 */
|
.nav-box .nav-bar .nav-bar-left,
|
||||||
.tab-scroll {
|
.nav-box .nav-bar .nav-bar-right {
|
||||||
white-space: nowrap;
|
padding: 0 20rpx;
|
||||||
/* 禁止换行 */
|
min-width: 36rpx;
|
||||||
background-color: #f7f8fa;
|
|
||||||
padding: 10px 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab-item {
|
.nav-box .nav-bar .nav-bar-left van-icon {
|
||||||
display: inline-block;
|
vertical-align: sub;
|
||||||
padding: 10px 20px;
|
color: #333333;
|
||||||
font-size: 16px;
|
}
|
||||||
color: #333;
|
|
||||||
|
.nav-box .nav-bar .nav-bar-title {
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-box .nav-bar-title {
|
||||||
|
color: red;
|
||||||
|
margin-left: -20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* 内容区域样式 */
|
.water-filter {
|
||||||
.content-scroll {
|
|
||||||
white-space: nowrap;
|
|
||||||
/* 禁止换行 */
|
|
||||||
height: 300px;
|
|
||||||
/* 设置内容区域高度 */
|
|
||||||
}
|
|
||||||
|
|
||||||
.content-item {
|
|
||||||
display: inline-block;
|
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
/* 每个内容项占满屏幕宽度 */
|
overflow: hidden;
|
||||||
height: 100%;
|
}
|
||||||
|
|
||||||
|
.nowrap {
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top {
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 位置定位 */
|
||||||
|
.positioning {
|
||||||
|
display: flex;
|
||||||
|
margin-left: 24rpx;
|
||||||
|
padding-top: 40rpx;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
margin-bottom: 64rpx;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.positioning-left {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.positioning-right {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.positioning-icon-left {
|
||||||
|
width: 33rpx;
|
||||||
|
height: 33rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.positioning-text {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
margin-left: 9rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
.positioning-icon-right {
|
||||||
|
width: 24rpx;
|
||||||
|
height: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 净化前后数值 */
|
||||||
|
.purification-value {
|
||||||
|
display: flex;
|
||||||
|
margin-left: 114rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.purification-value-left {
|
||||||
|
display: inline;
|
||||||
|
width: 210rpx;
|
||||||
|
height: 250rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.purification-value-right {
|
||||||
|
margin-left: 116rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.purification-value-icon {
|
||||||
|
width: 210rpx;
|
||||||
|
height: 250rpx;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
.purification-value-text {
|
||||||
|
position: absolute;
|
||||||
|
margin: 60rpx 42rpx 0 41rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.puri-text {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
color: #FFFFFF;
|
||||||
font-size: 20px;
|
|
||||||
border-bottom: 1px solid #eee;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.tab-item.active {
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #222222;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tab-item.active::after {
|
|
||||||
content: '';
|
|
||||||
width: 127rpx;
|
|
||||||
height: 10rpx;
|
|
||||||
background: #2583FF;
|
|
||||||
position: absolute;
|
|
||||||
left: 50%;
|
|
||||||
transform: translateX(-50%);
|
|
||||||
bottom: 0;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.tab-item.active::before {
|
|
||||||
content: '';
|
|
||||||
width: 127rpx;
|
|
||||||
height: 10rpx;
|
|
||||||
background: #FF5D73;
|
|
||||||
position: absolute;
|
|
||||||
left: 50%;
|
|
||||||
transform: translateX(-50%);
|
|
||||||
bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.deviceInfo {
|
|
||||||
padding: 30rpx 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.deviceInfo_Tit {
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #222222;
|
|
||||||
margin-bottom: 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.deviceInfo_Item {
|
|
||||||
display: flex;
|
|
||||||
align-items: flex-start;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.deviceInfo_Item_ask {
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
color: #999999;
|
|
||||||
margin-right: 30rpx;
|
|
||||||
min-width: 110rpx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.deviceInfo_Item_con {
|
.tds {
|
||||||
font-weight: 400;
|
opacity: 0.5;
|
||||||
font-size: 26rpx;
|
|
||||||
color: #222222;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.btnList {
|
.tds-value {
|
||||||
|
font-size: 50rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 净化前后水质 */
|
||||||
|
.water-quality {
|
||||||
|
margin-left: 80rpx;
|
||||||
|
margin-top: 23rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.water-quality2 {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
margin: 0 80rpx;
|
||||||
margin-top: 40rpx;
|
margin-top: 10rpx;
|
||||||
color: #fff;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding: 0 82rpx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn {
|
.water-quality2 .water-quality-left {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
text-align: center;
|
||||||
|
height: auto;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.water-quality2 .water-quality-text {
|
||||||
width: 150rpx;
|
width: 150rpx;
|
||||||
height: 50rpx;
|
height: 50rpx;
|
||||||
|
background: #fff;
|
||||||
border-radius: 100rpx 100rpx 100rpx 100rpx;
|
border-radius: 100rpx 100rpx 100rpx 100rpx;
|
||||||
|
color: #2583FF;
|
||||||
|
display: block;
|
||||||
|
line-height: 50rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.water-quality-left {
|
||||||
|
display: inline;
|
||||||
|
width: 265rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
padding: 10rpx 38rpx 10rpx 30rpx;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
background: linear-gradient(to right, #2583FF1a, #2583FF);
|
||||||
|
}
|
||||||
|
|
||||||
|
.water-quality-text {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 我的设备 */
|
||||||
|
.my-device {
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
/* margin: 0 24rpx 0 20rpx; */
|
||||||
|
/* padding-bottom: 30rpx; */
|
||||||
|
}
|
||||||
|
|
||||||
|
.mydevice {
|
||||||
|
font-size: 28rpx;
|
||||||
|
display: flex;
|
||||||
|
margin-bottom: 23rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-color {
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.replayBtn {
|
||||||
|
width: 120rpx;
|
||||||
|
height: 50rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
background-color: #2887ff;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
margin-left: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn1 {
|
.day-num2 {
|
||||||
background: #2583FF;
|
color: #ff0000da;
|
||||||
|
font-size: 36rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
margin: 0 7rpx 0 8rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn2 {
|
.device-info {
|
||||||
background: #999999;
|
margin: 0 24rpx 0 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn3 {
|
.info-top {
|
||||||
background: #D5AC66;
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
.filter_Info {
|
.device-name {
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #222222;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-state {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.switch-icon {
|
||||||
|
width: 28rpx;
|
||||||
|
height: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.switch-text {
|
||||||
|
margin-right: 31rpx;
|
||||||
|
margin-left: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wifi-text {
|
||||||
|
margin-left: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-size {
|
||||||
|
font-size: 26rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wifi-icon {
|
||||||
|
width: 30rpx;
|
||||||
|
height: 22rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-bottom {
|
||||||
|
display: flex;
|
||||||
|
margin-top: 22rpx;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-id {
|
||||||
|
color: #2583FF;
|
||||||
|
/* display: inline; */
|
||||||
|
}
|
||||||
|
|
||||||
|
.service-day {
|
||||||
|
/* display: inline; */
|
||||||
|
/* float: right; */
|
||||||
|
}
|
||||||
|
|
||||||
|
.day-num {
|
||||||
|
color: #2583FF;
|
||||||
|
font-size: 36rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
margin: 0 7rpx 0 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.day {
|
||||||
|
color: #222222;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 购买滤芯和报修记录 */
|
||||||
|
.van-row {
|
||||||
|
padding: 0 20rpx !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.van-col {
|
||||||
|
display: flex;
|
||||||
|
background-color: #FFF0ED;
|
||||||
|
height: 150rpx;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.purchase {
|
||||||
|
width: 100rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
margin-left: 68rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 功能列表 */
|
||||||
|
.van-grid {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.van-icon__image {
|
||||||
|
width: 100rpx !important;
|
||||||
|
height: 100rpx !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.van-icon--image {
|
||||||
|
width: 100rpx !important;
|
||||||
|
height: 100rpx !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.van-grid-item__text {
|
||||||
|
font-size: 26rpx !important;
|
||||||
|
color: #222222 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 滤芯寿命 */
|
||||||
|
.lifetime {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
background-color: #FFFFFF;
|
||||||
padding: 30rpx 20rpx;
|
padding: 30rpx 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.lifetime-title {
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lifetime-prompt {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999999;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
margin-bottom: 25rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.lifetime-progress {
|
.lifetime-progress {
|
||||||
|
margin-top: 10rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin-bottom: 30rpx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.progress-name {
|
.progress-name {
|
||||||
font-weight: 400;
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #999999;
|
|
||||||
width: 20%;
|
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
/* width: 24%; */
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
font-size: 26rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding-top: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.van-progress {
|
.van-progress {
|
||||||
width: 366rpx;
|
width: 100%;
|
||||||
margin-right: 19rpx;
|
margin-right: 19rpx;
|
||||||
margin-top: 10rpx;
|
margin-top: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.progress {
|
.progress {
|
||||||
|
color: #000000;
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contral3 {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.equi-contral-right2 {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 用水量 */
|
||||||
|
.water-consumption {
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
padding: 30rpx 24rpx 0 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.water-consumption-title {
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row-index--van-row {
|
||||||
|
margin: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.van-col--8 {
|
||||||
|
display: inline;
|
||||||
|
height: 130rpx !important;
|
||||||
|
width: 220rpx !important;
|
||||||
|
margin-right: 5rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.water-consumption-col-name {
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: normal;
|
||||||
|
color: #000000;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 12rpx;
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.water-consumption-col-num {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 38rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #2583FF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.water-consumption-col-num-size {
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
width: 100%;
|
||||||
|
height: 600rpx;
|
||||||
|
padding-bottom: 100rpx;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.container canvas {
|
||||||
|
position: absolute;
|
||||||
|
right: -100vw;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#mychart-bar {
|
||||||
|
border-radius: 30rpx 30rpx 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chart {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
height: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bar {
|
||||||
|
width: 20px;
|
||||||
|
margin: 0 5px;
|
||||||
|
background-color: blue;
|
||||||
|
border-radius: 30rpx 30rpx 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.water-consumption-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.water-consumption-col {
|
||||||
|
width: 220rpx;
|
||||||
|
height: 112rpx;
|
||||||
|
background: linear-gradient(180deg, #F0F4FF 0%, #DEE7FF 100%);
|
||||||
|
border-radius: 20rpx 20rpx 20rpx 20rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.water-consumption-row .col2 {
|
||||||
|
background: linear-gradient(180deg, #FFFBD8 0%, #FFEBB8 100%);
|
||||||
|
margin: 0 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.water-consumption-row .col3 {
|
||||||
|
background: linear-gradient(180deg, #ECECEC 0%, #E5E4E4 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.water-consumption-col .water-consumption-col-name {
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 26rpx;
|
font-size: 24rpx;
|
||||||
color: #FFFFFF;
|
color: #000000;
|
||||||
width: 90rpx;
|
}
|
||||||
height: 36rpx;
|
|
||||||
|
.water-consumption-col .water-consumption-col-num {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #2583FF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.equi-contral {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-left: 20rpx;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.equi-contral2 .equi-contral-right {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.equi-contral2 .equi-contral-right .equi-contral-right-btn2 {
|
||||||
|
margin-top: 0;
|
||||||
|
width: 335rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.equi-contral2 .equi-contral-right .equi-contral-right-btn1 {
|
||||||
|
margin-top: 0;
|
||||||
|
width: 335rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.equi-contral-left {
|
||||||
|
position: relative;
|
||||||
|
width: 345rpx;
|
||||||
|
height: 320rpx;
|
||||||
|
background: #FFF0ED;
|
||||||
|
border-radius: 30rpx 30rpx 30rpx 30rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #000000;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding-top: 58rpx;
|
||||||
|
padding-left: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.equi-contral-left #img1 {
|
||||||
|
width: 219.21rpx;
|
||||||
|
height: 175rpx;
|
||||||
|
position: absolute;
|
||||||
|
left: 116rpx;
|
||||||
|
bottom: 5rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.equi-contral-left #img2 {
|
||||||
|
width: 119rpx;
|
||||||
|
height: 95rpx;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 32rpx;
|
||||||
|
left: 180rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.van-grid-item__text text {
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.equi-contral-right {
|
||||||
|
/* justify-content: center !important; */
|
||||||
|
}
|
||||||
|
|
||||||
|
.equi-contral-right-btn1 {
|
||||||
|
width: 345rpx;
|
||||||
|
height: 150rpx;
|
||||||
|
background: linear-gradient(180deg, #FFFBD8 0%, #FFEBB8 100%);
|
||||||
|
border-radius: 20rpx 20rpx 20rpx 20rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #000000;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding-left: 30rpx;
|
||||||
|
padding-right: 30rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.equi-contral-right-btn1 image {
|
||||||
|
width: 100rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.equi-contral-right-btn2 {
|
||||||
|
width: 345rpx;
|
||||||
|
height: 150rpx;
|
||||||
|
background: linear-gradient(180deg, #ECECEC 0%, #E5E4E4 100%);
|
||||||
|
border-radius: 20rpx 20rpx 20rpx 20rpx;
|
||||||
|
margin-top: 23rpx;
|
||||||
|
position: relative;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #000000;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding-left: 30rpx;
|
||||||
|
padding-right: 30rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.equi-contral-right-btn2 image {
|
||||||
|
width: 100rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.foot-fixed {
|
||||||
|
z-index: 999999999999 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btnDevice {
|
||||||
|
width: 650rpx;
|
||||||
|
height: 80rpx;
|
||||||
background: #2583FF;
|
background: #2583FF;
|
||||||
border-radius: 100rpx 100rpx 100rpx 100rpx;
|
border-radius: 100rpx 100rpx 100rpx 100rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 300rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
.owner{
|
.deleteBtn {
|
||||||
padding: 30rpx 20rpx;
|
width: 710rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
background-color: #dd0000;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
font-size: 34rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.btn3 {
|
||||||
|
background: #D5AC66;
|
||||||
|
width: 710rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
font-size: 34rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn4 {
|
||||||
|
background: #67C23A;
|
||||||
|
width: 710rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
font-size: 34rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 40rpx;
|
||||||
|
}
|
||||||
|
.btn5{
|
||||||
|
background-color: #909399;
|
||||||
|
width: 710rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
font-size: 34rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row {
|
||||||
|
padding-top: 30rpx;
|
||||||
|
height: 300rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
overflow-y: auto;
|
||||||
|
padding: 30rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-size: 30rpx;
|
||||||
|
display: flex;
|
||||||
|
color: #606266;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row2 {
|
||||||
|
padding-top: 30rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
overflow-y: auto;
|
||||||
|
padding: 30rpx;
|
||||||
|
padding-bottom: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-size: 30rpx;
|
||||||
|
display: flex;
|
||||||
|
color: #606266;
|
||||||
|
}
|
||||||
|
.row_label {
|
||||||
|
margin-right: 20rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row_con {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row_con textarea {
|
||||||
|
height: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tit {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
font-size: 32rpx;
|
||||||
|
padding-right: 30rpx;
|
||||||
|
padding-left: 30rpx;
|
||||||
|
padding-top: 20rpx;
|
||||||
}
|
}
|
||||||
@ -12,37 +12,32 @@ Page({
|
|||||||
option1: [
|
option1: [
|
||||||
{ text: '全部', value: 0 },
|
{ text: '全部', value: 0 },
|
||||||
{ text: '已安装', value: 1 },
|
{ text: '已安装', value: 1 },
|
||||||
{ text: '空闲', value: 2 },
|
{ text: '待启用', value: 2 },
|
||||||
{ text: '已拆机', value: 3 },
|
{ text: '已拆机', value: 3 },
|
||||||
],
|
],
|
||||||
option2: [
|
option2: [
|
||||||
{ text: '全部', value: 0 },
|
{ text: '全部', value: 0 },
|
||||||
{ text: '正常', value: 1 },
|
{ text: '在用', value: 1 },
|
||||||
{ text: '报废', value: 2 },
|
{ text: '待启用', value: 2 },
|
||||||
{ text: '待启用', value: 3 },
|
{ text: '关机', value: 3 },
|
||||||
{ text: '已拆机', value: 4 },
|
{ text: '已拆机', value: 4 },
|
||||||
{ text: '漏水', value: 5 },
|
{ text: '漏水', value: 5 },
|
||||||
{ text: '制水故障', value: 6 },
|
{ text: '制水故障', value: 6 }
|
||||||
{ text: '关机', value: 7 },
|
|
||||||
{ text: '已欠费', value: 8 },
|
|
||||||
{ text: '在库', value: 9 },
|
|
||||||
{ text: '激活失败', value: 10 },
|
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
||||||
stateType: {
|
stateType: {
|
||||||
1: '正常',
|
1: '在用',
|
||||||
2: '报废',
|
2: '待启用',
|
||||||
3: '待启用',
|
3: '关机',
|
||||||
4: '已拆机',
|
4: '已拆机',
|
||||||
5: '漏水',
|
5: '漏水',
|
||||||
6: '制水故障',
|
6: '制水故障',
|
||||||
7: '关机',
|
7: '报废',
|
||||||
8: '已欠费',
|
8: '已欠费',
|
||||||
9: '在库',
|
9: '在库',
|
||||||
|
10: '激活失败'
|
||||||
},
|
},
|
||||||
value1: 0,
|
value1: 0,
|
||||||
value2: 'a',
|
value2: 0,
|
||||||
nav_list: {},
|
nav_list: {},
|
||||||
foot_width: "",
|
foot_width: "",
|
||||||
|
|
||||||
@ -51,17 +46,22 @@ Page({
|
|||||||
page_size: 10,
|
page_size: 10,
|
||||||
flag: false,
|
flag: false,
|
||||||
total: '',
|
total: '',
|
||||||
deviceList: []
|
deviceList: [],
|
||||||
|
dropdownOpen:false,
|
||||||
|
text2:"设备状态:全部"
|
||||||
|
},
|
||||||
|
onDropdownOpen() {
|
||||||
|
console.log(123);
|
||||||
|
this.setData({ dropdownOpen: true });
|
||||||
|
},
|
||||||
|
onDropdownClose() {
|
||||||
|
this.setData({ dropdownOpen: false });
|
||||||
},
|
},
|
||||||
|
|
||||||
ipt1(e) {
|
ipt1(e) {
|
||||||
let that = this
|
let that = this
|
||||||
that.setData({
|
that.setData({
|
||||||
searchText: e.detail.value,
|
searchText: e.detail.value,
|
||||||
page_num: 1,
|
|
||||||
deviceList: [],
|
|
||||||
})
|
})
|
||||||
that.getDeviceList()
|
|
||||||
},
|
},
|
||||||
|
|
||||||
deviceDesc(e) {
|
deviceDesc(e) {
|
||||||
@ -85,29 +85,62 @@ Page({
|
|||||||
deviceList: []
|
deviceList: []
|
||||||
});
|
});
|
||||||
if (e.detail == 0) {
|
if (e.detail == 0) {
|
||||||
this.getDeviceList();
|
this.getDeviceList(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.getDeviceList(e.detail, '');
|
this.getDeviceList(e.detail);
|
||||||
},
|
},
|
||||||
|
|
||||||
// 设备管理选择
|
// 设备管理选择
|
||||||
headerEquipmentClick(e) {
|
headerEquipmentClick(e) {
|
||||||
|
let that = this
|
||||||
|
let text2 = ''
|
||||||
|
if(e.detail == 0){
|
||||||
|
text2 = '设备状态:全部'
|
||||||
|
}else if(e.detail == 1){
|
||||||
|
text2 = '设备状态:在用'
|
||||||
|
}else if(e.detail == 2){
|
||||||
|
text2 = '设备状态:待启用'
|
||||||
|
}else if(e.detail == 3){
|
||||||
|
text2 = '设备状态:关机'
|
||||||
|
}else if(e.detail == 4){
|
||||||
|
text2 = '设备状态:已拆机'
|
||||||
|
}else if(e.detail == 5){
|
||||||
|
text2 = '设备状态:漏水'
|
||||||
|
}else if(e.detail == 6){
|
||||||
|
text2 = '设备状态:制水故障'
|
||||||
|
}else if(e.detail == 7){
|
||||||
|
text2 = '设备状态:报废'
|
||||||
|
}else if(e.detail == 8){
|
||||||
|
text2 = '设备状态:已欠费'
|
||||||
|
}else if(e.detail == 9){
|
||||||
|
text2 = '设备状态:在库'
|
||||||
|
}else if(e.detail == 10){
|
||||||
|
text2 = '设备状态:激活失败'
|
||||||
|
}
|
||||||
this.setData({
|
this.setData({
|
||||||
value2: e.detail,
|
value2: e.detail,
|
||||||
value1: 0,
|
|
||||||
page_num: 1,
|
page_num: 1,
|
||||||
deviceList: []
|
deviceList: [],
|
||||||
|
text2
|
||||||
});
|
});
|
||||||
if (e.detail == 0) {
|
if (e.detail == 0) {
|
||||||
this.getDeviceList();
|
this.getDeviceList(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.getDeviceList('', e.detail);
|
this.getDeviceList(e.detail);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
search2(){
|
||||||
getDeviceList(networkStatus, status) {
|
let that=this
|
||||||
|
that.setData({
|
||||||
|
deviceList:[],
|
||||||
|
flag:false,
|
||||||
|
page_num:1
|
||||||
|
})
|
||||||
|
that.getDeviceList(that.data.value2)
|
||||||
|
},
|
||||||
|
getDeviceList(status) {
|
||||||
wx.showLoading({
|
wx.showLoading({
|
||||||
title: '加载中',
|
title: '加载中',
|
||||||
mask: true
|
mask: true
|
||||||
@ -118,22 +151,11 @@ Page({
|
|||||||
page_size: that.data.page_size,
|
page_size: that.data.page_size,
|
||||||
page_num: that.data.page_num,
|
page_num: that.data.page_num,
|
||||||
search: that.data.searchText,
|
search: that.data.searchText,
|
||||||
dealer_id: admin.shop_id
|
info_id: wx.getStorageSync('info_id'),
|
||||||
};
|
|
||||||
if (networkStatus) {
|
|
||||||
param = {
|
|
||||||
...param,
|
|
||||||
install_status: networkStatus
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (status) {
|
|
||||||
param = {
|
|
||||||
...param,
|
|
||||||
status: Number(status),
|
status: Number(status),
|
||||||
}
|
};
|
||||||
}
|
|
||||||
|
|
||||||
util.postUrl4(apiArr2.deviceList, param, res => {
|
util.postUrl(apiArr.masterDeviceList, param, res => {
|
||||||
wx.hideLoading()
|
wx.hideLoading()
|
||||||
let flag = false
|
let flag = false
|
||||||
if (res.list && res.list.length == that.data.page_size) {
|
if (res.list && res.list.length == that.data.page_size) {
|
||||||
@ -144,7 +166,7 @@ Page({
|
|||||||
flag = false
|
flag = false
|
||||||
}
|
}
|
||||||
that.setData({
|
that.setData({
|
||||||
deviceList: that.data.deviceList.concat(res.list || []),
|
deviceList: that.data.deviceList.concat(res.rows || []),
|
||||||
total: res.total,
|
total: res.total,
|
||||||
flag,
|
flag,
|
||||||
page_num: that.data.page_num + 1
|
page_num: that.data.page_num + 1
|
||||||
@ -157,7 +179,7 @@ Page({
|
|||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.getDeviceList();
|
this.getDeviceList(0);
|
||||||
wx.showShareMenu({
|
wx.showShareMenu({
|
||||||
withShareTicket: true,
|
withShareTicket: true,
|
||||||
menus: ['shareAppMessage', 'shareTimeline']
|
menus: ['shareAppMessage', 'shareTimeline']
|
||||||
@ -196,7 +218,18 @@ Page({
|
|||||||
* 页面相关事件处理函数--监听用户下拉动作
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
*/
|
*/
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
flag:false,
|
||||||
|
page_num:1,
|
||||||
|
total:0,
|
||||||
|
searchText:"",
|
||||||
|
value1:"",
|
||||||
|
value2:"",
|
||||||
|
deviceList:[]
|
||||||
|
})
|
||||||
|
that.getDeviceList(0);
|
||||||
|
wx.stopPullDownRefresh();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -204,9 +237,8 @@ Page({
|
|||||||
*/
|
*/
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
let that = this
|
let that = this
|
||||||
console.log(123, that.data.flag);
|
|
||||||
if (that.data.flag) {
|
if (that.data.flag) {
|
||||||
that.getDeviceList('', that.data.value2)
|
that.getDeviceList( that.data.value2)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
"usingComponents": {},
|
"usingComponents": {},
|
||||||
"navigationBarTitleText": "设备管理"
|
"navigationBarTitleText": "设备管理",
|
||||||
|
"enablePullDownRefresh": true
|
||||||
}
|
}
|
||||||
@ -1,32 +1,35 @@
|
|||||||
<view class="deviceList">
|
<view class="deviceList" class="page-container {{ dropdownOpen ? 'fixed-page' : '' }}">
|
||||||
<view class="white">
|
<view class="white">
|
||||||
<view class="deviceImg">
|
<view class="deviceImg">
|
||||||
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/dervice/deviceList.png?1" mode="widthFix" />
|
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/dervice/deviceList.png?1" mode="widthFix" />
|
||||||
</view>
|
</view>
|
||||||
<view class="deviceText">设备总数:{{total}}</view>
|
<view class="deviceText">设备总数:{{total}}</view>
|
||||||
<view class="deviceIpt">
|
<view class="deviceIpt">
|
||||||
<input type="text" value="{{searchText}}" bindinput="ipt1" placeholder="设备编码" placeholder-style="color: #999999;font-size: 24rpx;" />
|
<input type="text" confirm-type="search" bindconfirm="search2" value="{{searchText}}" bindinput="ipt1" placeholder="设备编号/客户名称/客户手机/客户地址" placeholder-style="color: #999999;font-size: 28rpx;" />
|
||||||
|
|
||||||
|
<view class="searchBox" bind:tap="search2">
|
||||||
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/dervice/deriveSearch.png?1?1" mode="widthFix" />
|
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/dervice/deriveSearch.png?1?1" mode="widthFix" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<view class="dropBox">
|
<view class="dropBox">
|
||||||
<van-dropdown-menu>
|
<van-dropdown-menu>
|
||||||
<van-dropdown-item title="{{'安装状态'}}" value="{{ value1 }}" options="{{ option1 }}" bind:change="headerNetWorkClick" />
|
<!-- <van-dropdown-item bind:open="onDropdownOpen" bind:close="onDropdownClose" title="{{'安装状态'}}" value="{{ value1 }}" options="{{ option1 }}" bind:change="headerNetWorkClick" /> -->
|
||||||
<van-dropdown-item icon="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/dervice/deviceList_downIcon.png" title="设备状态" value="{{ value2 }}" options="{{ option2 }}" bind:change="headerEquipmentClick" />
|
<van-dropdown-item bind:open="onDropdownOpen" bind:close="onDropdownClose" title="{{text2}}" value="{{ value2 }}" options="{{ option2 }}" bind:change="headerEquipmentClick" />
|
||||||
</van-dropdown-menu>
|
</van-dropdown-menu>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="deviceItem_box">
|
<view class="deviceItem_box">
|
||||||
<view class="deviceItem" wx:if="{{deviceList.length != 0}}" wx:for="{{deviceList}}" bind:tap="deviceDesc" data-device_id="{{item.device_id}}">
|
<view class="deviceItem" wx:if="{{deviceList.length != 0 && item.install_status!= 2}}" wx:for="{{deviceList}}" bind:tap="deviceDesc" data-device_id="{{item.device_id}}">
|
||||||
<view class="deviceItem_Tit">设备编码:{{item.device_code}}</view>
|
<view class="deviceItem_Tit">设备编码:{{item.device_code}}</view>
|
||||||
<view class="deviceItemCon">
|
<view class="deviceItemCon">
|
||||||
<view class="deviceItemCon_tit">客户姓名</view>
|
<view class="deviceItemCon_tit">客户姓名</view>
|
||||||
<view class="deviceItemCon_con">{{item.customer_name}}</view>
|
<view class="deviceItemCon_con">{{item.customer_info.name}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="deviceItemCon">
|
<view class="deviceItemCon">
|
||||||
<view class="deviceItemCon_tit">客户手机</view>
|
<view class="deviceItemCon_tit">客户手机</view>
|
||||||
<view class="deviceItemCon_con">{{item.customer_phone}}</view>
|
<view class="deviceItemCon_con">{{item.customer_info.phone}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="deviceItemCon">
|
<view class="deviceItemCon">
|
||||||
<view class="deviceItemCon_tit">网络状态</view>
|
<view class="deviceItemCon_tit">网络状态</view>
|
||||||
@ -45,10 +48,9 @@
|
|||||||
|
|
||||||
<view class="deviceItemCon">
|
<view class="deviceItemCon">
|
||||||
<view class="deviceItemCon_tit">设备地址</view>
|
<view class="deviceItemCon_tit">设备地址</view>
|
||||||
<view class="deviceItemCon_con">{{item.address}}</view>
|
<view class="deviceItemCon_con">{{item.region}}{{item.address}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view wx:if="{{deviceList.length == 0}}">
|
<view wx:if="{{deviceList.length == 0}}">
|
||||||
<van-empty description="暂无内容" />
|
<van-empty description="暂无内容" />
|
||||||
</view>
|
</view>
|
||||||
@ -57,7 +59,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<view class="addBtn" bind:tap="addWorkOrders">新增</view>
|
<!-- <view class="addBtn" bind:tap="addWorkOrders">新增</view> -->
|
||||||
|
|
||||||
<cover-view style="position: fixed;">
|
<cover-view style="position: fixed;">
|
||||||
<import src="/pages/public/footer.wxml" />
|
<import src="/pages/public/footer.wxml" />
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
.deviceList {
|
.deviceList {
|
||||||
background-color: #F9F9F9;
|
background-color: #F9F9F9;
|
||||||
padding-bottom: 120rpx;
|
padding-bottom: 120rpx;
|
||||||
@ -9,6 +8,13 @@
|
|||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fixed-page {
|
||||||
|
position: fixed;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
.deviceImg {
|
.deviceImg {
|
||||||
width: 157rpx;
|
width: 157rpx;
|
||||||
height: 157rpx;
|
height: 157rpx;
|
||||||
@ -32,7 +38,7 @@
|
|||||||
|
|
||||||
.deviceIpt {
|
.deviceIpt {
|
||||||
width: 710rpx;
|
width: 710rpx;
|
||||||
height: 54rpx;
|
height: 70rpx;
|
||||||
background: #F9F9F9;
|
background: #F9F9F9;
|
||||||
border-radius: 100rpx 100rpx 100rpx 100rpx;
|
border-radius: 100rpx 100rpx 100rpx 100rpx;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
@ -50,9 +56,9 @@
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.deviceIpt image{
|
.deviceIpt image {
|
||||||
width: 30rpx;
|
width: 40rpx;
|
||||||
height: 30rpx;
|
height: 40rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropBox .van-dropdown-menu {
|
.dropBox .van-dropdown-menu {
|
||||||
@ -85,17 +91,25 @@
|
|||||||
|
|
||||||
.deviceItemCon_tit {
|
.deviceItemCon_tit {
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 26rpx;
|
font-size: 28rpx;
|
||||||
color: #999999;
|
color: #999999;
|
||||||
margin-right: 30rpx;
|
margin-right: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.deviceItemCon_con {
|
.deviceItemCon_con {
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 26rpx;
|
font-size: 28rpx;
|
||||||
color: #222222;
|
color: #222222;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.searchBox {
|
||||||
|
padding-left: 30rpx;
|
||||||
|
height: 54rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.addBtn {
|
.addBtn {
|
||||||
@ -116,14 +130,14 @@
|
|||||||
|
|
||||||
.addBtn::after {
|
.addBtn::after {
|
||||||
content: '';
|
content: '';
|
||||||
background: rgba(77, 154, 255,.5);
|
background: rgba(77, 154, 255, .5);
|
||||||
filter: blur(10.899999618530273rpx);
|
filter: blur(10.899999618530273rpx);
|
||||||
width: 90rpx;
|
width: 90rpx;
|
||||||
height: 90rpx;
|
height: 90rpx;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
transform: translate(-50%,-50%);
|
transform: translate(-50%, -50%);
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
|
|||||||
@ -72,6 +72,7 @@ Page({
|
|||||||
}
|
}
|
||||||
|
|
||||||
res.list.forEach(item => {
|
res.list.forEach(item => {
|
||||||
|
console.log(item, 'zzzz');
|
||||||
// 计算已使用天数
|
// 计算已使用天数
|
||||||
item.difDay = that.getDaysBetweenDates(item.start_time || item.create_time);
|
item.difDay = that.getDaysBetweenDates(item.start_time || item.create_time);
|
||||||
|
|
||||||
@ -85,6 +86,36 @@ Page({
|
|||||||
(1 - (item.threshold_volume || 0) / (item.available_volume || 1)) * 100
|
(1 - (item.threshold_volume || 0) / (item.available_volume || 1)) * 100
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const first = res.list.findIndex(item =>
|
||||||
|
item.parts_name.indexOf("PP棉滤芯") !== -1
|
||||||
|
);
|
||||||
|
if (first !== -1) {
|
||||||
|
const [removed] = res.list.splice(first, 1); // 移除该对象
|
||||||
|
res.list.unshift(removed); // 插入到首位
|
||||||
|
}
|
||||||
|
const Second = res.list.findIndex(item =>
|
||||||
|
item.parts_name.indexOf("PP+CB") !== -1
|
||||||
|
);
|
||||||
|
if (Second !== -1) {
|
||||||
|
const [removed] = res.list.splice(Second, 1); // 移除该对象
|
||||||
|
res.list.splice(1, 0, removed); // 插入到第二位
|
||||||
|
}
|
||||||
|
const Third = res.list.findIndex(item =>
|
||||||
|
item.parts_name.indexOf("RO") !== -1
|
||||||
|
);
|
||||||
|
if (Third !== -1) {
|
||||||
|
const [removed] = res.list.splice(Third, 1); // 移除该对象
|
||||||
|
res.list.splice(2, 0, removed); // 插入到第二位
|
||||||
|
}
|
||||||
|
const Fourth = res.list.findIndex(item =>
|
||||||
|
item.parts_name.indexOf("后置活性炭") !== -1
|
||||||
|
);
|
||||||
|
if (Fourth !== -1) {
|
||||||
|
const [removed] = res.list.splice(Fourth, 1); // 移除该对象
|
||||||
|
res.list.splice(3, 0, removed); // 插入到第二位
|
||||||
|
}
|
||||||
|
|
||||||
that.setData({
|
that.setData({
|
||||||
filterList: res.list
|
filterList: res.list
|
||||||
})
|
})
|
||||||
@ -211,9 +242,9 @@ Page({
|
|||||||
that.queryPay()
|
that.queryPay()
|
||||||
},
|
},
|
||||||
fail(fal) {
|
fail(fal) {
|
||||||
if(fal.errMsg == 'requestPayment:fail cancel'){
|
if (fal.errMsg == 'requestPayment:fail cancel') {
|
||||||
that.payFail(2)
|
that.payFail(2)
|
||||||
}else{
|
} else {
|
||||||
that.payFail(1)
|
that.payFail(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -222,13 +253,13 @@ Page({
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
payFail(e){
|
payFail(e) {
|
||||||
let that = this
|
let that = this
|
||||||
util.postUrl(PayJs.payFail,{
|
util.postUrl(PayJs.payFail, {
|
||||||
order_id:that.data.orderMsg.OrderId,
|
order_id: that.data.orderMsg.OrderId,
|
||||||
type:"3",
|
type: "3",
|
||||||
state:e,
|
state: e,
|
||||||
},res=>{
|
}, res => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@ -39,20 +39,20 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="filter_Item_Info_desc" wx:if="{{billing_method == 1}}">
|
<view class="filter_Item_Info_desc" wx:if="{{billing_method == 1}}">
|
||||||
<view class="hide"></view>
|
<!-- <view class="hide"></view> -->
|
||||||
<view class="filter_Item_Info_descText">
|
<view class="filter_Item_Info_descText">
|
||||||
剩余可用{{item.available_days}}天
|
预计剩余寿命:{{item.available_days}}天
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="filter_Item_Info_desc" wx:if="{{billing_method == 2}}">
|
<view class="filter_Item_Info_desc" wx:if="{{billing_method == 2}}">
|
||||||
<view class="hide"></view>
|
<!-- <view class="hide"></view> -->
|
||||||
<view class="filter_Item_Info_descText">
|
<view class="filter_Item_Info_descText">
|
||||||
剩余流量{{item.remaining_volume}}
|
预计剩余寿命:{{item.remaining_volume}}升
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="filter_Item_Info_desc" wx:if="{{billing_method == 3}}">
|
<view class="filter_Item_Info_desc" wx:if="{{billing_method == 3}}">
|
||||||
<view class="payBtn" catch:tap="pay3" data-item="{{item}}">购买</view>
|
<view class="payBtn" catch:tap="pay3" data-item="{{item}}">购买</view>
|
||||||
<view class="filter_Item_Info_descText">剩余可用{{item.available_days}}天</view>
|
<view class="filter_Item_Info_descText"> 预计剩余寿命:{{item.available_days}}天</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@ -115,7 +115,7 @@
|
|||||||
|
|
||||||
.filter_Item_Info_desc {
|
.filter_Item_Info_desc {
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 22rpx;
|
font-size: 24rpx;
|
||||||
color: #999999;
|
color: #999999;
|
||||||
margin-top: 10rpx;
|
margin-top: 10rpx;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
const apiArr = require("~/api/water_filter");
|
const apiArr = require("../../../../api/water_filter");
|
||||||
const { postUrl } = require("~/utils/util");
|
const { postUrl } = require("../../../../utils/util");
|
||||||
const util = require("~/utils/util");
|
const util = require("../../../../utils/util");
|
||||||
|
|
||||||
// pages/water_filter/repair/repair.js
|
// pages/water_filter/repair/repair.js
|
||||||
const app = getApp()
|
const app = getApp()
|
||||||
@ -20,6 +20,8 @@ Page({
|
|||||||
name: "",
|
name: "",
|
||||||
phone: "",
|
phone: "",
|
||||||
message: "",
|
message: "",
|
||||||
|
address:"",
|
||||||
|
|
||||||
fileList: [],
|
fileList: [],
|
||||||
fileList2: [],
|
fileList2: [],
|
||||||
time: "",
|
time: "",
|
||||||
@ -42,6 +44,39 @@ Page({
|
|||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
},
|
},
|
||||||
|
currentDevice:{},
|
||||||
|
|
||||||
|
show2: false,
|
||||||
|
cityList: [],
|
||||||
|
areaList: [],
|
||||||
|
businessList: [],
|
||||||
|
newAreaList: [], // 默认展示 市区
|
||||||
|
newBusiness: [], // 默认展示 县/区
|
||||||
|
confirmCity: '',
|
||||||
|
confirmArea: '',
|
||||||
|
confirmBusiness: '',
|
||||||
|
},
|
||||||
|
choseRegion(){
|
||||||
|
this.setData({
|
||||||
|
show2:true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getInfo() {
|
||||||
|
wx.showLoading({
|
||||||
|
title: '加载中...',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
let that = this
|
||||||
|
util.postUrl(apiArr.deviceInfo, { device_id:wx.getStorageSync('device_id')}, res => {
|
||||||
|
wx.hideLoading()
|
||||||
|
that.setData({
|
||||||
|
currentDevice: res,
|
||||||
|
name:res.device_customer.name,
|
||||||
|
phone:res.device_customer.phone,
|
||||||
|
address:res.address,
|
||||||
|
region:res.region
|
||||||
|
})
|
||||||
|
})
|
||||||
},
|
},
|
||||||
deleteImg(e) {
|
deleteImg(e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
@ -74,6 +109,12 @@ Page({
|
|||||||
message: e.detail
|
message: e.detail
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
ipt4(e) {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
address: e.detail
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
switchShow() {
|
switchShow() {
|
||||||
let that = this
|
let that = this
|
||||||
@ -253,7 +294,8 @@ Page({
|
|||||||
device_id: selectEquipment.device_id,
|
device_id: selectEquipment.device_id,
|
||||||
fault_desc: message,
|
fault_desc: message,
|
||||||
fault_imgs: fileList2.length !== 0 ? fileList2[0].url : '',
|
fault_imgs: fileList2.length !== 0 ? fileList2[0].url : '',
|
||||||
user_id: Number(wx.getStorageSync('userId'))
|
user_id: Number(wx.getStorageSync('userId')),
|
||||||
|
|
||||||
}, res => {
|
}, res => {
|
||||||
wx.hideLoading();
|
wx.hideLoading();
|
||||||
if (res.error) {
|
if (res.error) {
|
||||||
@ -345,9 +387,92 @@ Page({
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
getSSQ() {
|
||||||
|
let that = this
|
||||||
|
util.postUrl2(apiArr.city, {}, res => {
|
||||||
|
util.postUrl2(apiArr.area, {}, res1 => {
|
||||||
|
util.postUrl2(apiArr.business, {}, res2 => {
|
||||||
|
wx.hideLoading();
|
||||||
|
// 省列表来自 res
|
||||||
|
let cityList = res.data.data.rows;
|
||||||
|
// 市列表来自 res1
|
||||||
|
let areaList = res1.data.data.rows;
|
||||||
|
// 区列表来自 res2
|
||||||
|
let businessList = res2.data.data.rows;
|
||||||
|
|
||||||
|
// 处理市列表,将衡水市放到最后
|
||||||
|
let hengshuiIndex = areaList.findIndex(item => item.name === '衡水市');
|
||||||
|
console.log(hengshuiIndex, 'hengshuiIndex');
|
||||||
|
if (hengshuiIndex !== -1) {
|
||||||
|
const hengshui = areaList.splice(hengshuiIndex, 1)[0];
|
||||||
|
areaList.push(hengshui);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(businessList);
|
||||||
|
// 处理区列表,将衡水市的桃城区放到最后一个
|
||||||
|
let taochengIndex = businessList.findIndex(item => item.business_name === '桃城区');
|
||||||
|
if (taochengIndex !== -1) {
|
||||||
|
const taocheng = businessList.splice(taochengIndex, 1)[0];
|
||||||
|
businessList.unshift(taocheng);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 默认展示第一条数据的省、市和区
|
||||||
|
let newArea = res1.data.data.rows.filter((item) => {
|
||||||
|
return item.city_id === res.data.data.rows[0].city_id
|
||||||
|
});
|
||||||
|
let newbus = res2.data.data.rows.filter((item) => {
|
||||||
|
return item.area_id === res1.data.data.rows[0].area_id
|
||||||
|
});
|
||||||
|
|
||||||
|
// 正确存储数据
|
||||||
|
wx.setStorageSync('cityList', cityList)
|
||||||
|
wx.setStorageSync('areaList', areaList)
|
||||||
|
wx.setStorageSync('businessList', businessList)
|
||||||
|
|
||||||
|
this.setData({
|
||||||
|
cityList: cityList,
|
||||||
|
areaList: areaList,
|
||||||
|
businessList: businessList,
|
||||||
|
newAreaList: newArea, // 默认展示市
|
||||||
|
newBusiness: newbus, // 默认展示区
|
||||||
|
confirmCity: cityList[0],
|
||||||
|
confirmArea: newArea[0],
|
||||||
|
confirmBusiness: newbus[0],
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onClose2() {
|
||||||
|
this.setData({
|
||||||
|
show2: false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
bindChange(e) {
|
||||||
|
const { value } = e.detail;
|
||||||
|
const { cityList, areaList, businessList } = this.data;
|
||||||
|
// 每次切换时,根据当前点击的省过滤出所属市区,并且试试变化县/区
|
||||||
|
let newArea = areaList.filter((item) => item.city_id === cityList[value[0]].city_id);
|
||||||
|
let newbus = businessList.filter((item) => item.area_id === newArea[value[1]].area_id);
|
||||||
|
this.setData({
|
||||||
|
newAreaList: newArea,
|
||||||
|
newBusiness: newbus,
|
||||||
|
confirmCity: cityList[value[0]],
|
||||||
|
confirmArea: newArea[value[1]],
|
||||||
|
confirmBusiness: newbus[value[2]],
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onOk() {
|
||||||
|
const { confirmCity, confirmArea, confirmBusiness } = this.data;
|
||||||
|
console.log(confirmCity, confirmArea, confirmBusiness);
|
||||||
|
this.setData({
|
||||||
|
show2: false,
|
||||||
|
region: `${confirmCity.name}${confirmArea.area_name}${confirmBusiness.business_name}`,
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -355,10 +480,36 @@ Page({
|
|||||||
*/
|
*/
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getInfo()
|
||||||
wx.showShareMenu({
|
wx.showShareMenu({
|
||||||
withShareTicket: true,
|
withShareTicket: true,
|
||||||
menus: ['shareAppMessage', 'shareTimeline']
|
menus: ['shareAppMessage', 'shareTimeline']
|
||||||
})
|
})
|
||||||
|
if (wx.getStorageSync('cityList') && wx.getStorageSync('areaList') && wx.getStorageSync('businessList')) {
|
||||||
|
let res = wx.getStorageSync('cityList')
|
||||||
|
let res1 = wx.getStorageSync('areaList')
|
||||||
|
let res2 = wx.getStorageSync('businessList')
|
||||||
|
console.log(res1);
|
||||||
|
// 默认展示第一条数据 的市区 和 城区
|
||||||
|
let newArea = res1.filter((item) => {
|
||||||
|
return item.city_id === res[0].city_id
|
||||||
|
});
|
||||||
|
let newbus = res2.filter((item) => {
|
||||||
|
return item.area_id === res1[0].area_id
|
||||||
|
});
|
||||||
|
this.setData({
|
||||||
|
cityList: res,
|
||||||
|
areaList: res1,
|
||||||
|
businessList: res2,
|
||||||
|
newAreaList: newArea, // 默认展示 市区
|
||||||
|
newBusiness: newbus, // 默认展示 县/区
|
||||||
|
confirmCity: res1[0],
|
||||||
|
confirmArea: newArea[0],
|
||||||
|
confirmBusiness: newbus[0],
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
that.getSSQ()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
@ -378,7 +529,8 @@ Page({
|
|||||||
item.product_icon = util.img_url + item.product_icon
|
item.product_icon = util.img_url + item.product_icon
|
||||||
})
|
})
|
||||||
this.setData({
|
this.setData({
|
||||||
equipmentList: res.rows || []
|
equipmentList: res.rows || [],
|
||||||
|
selectEquipment:res.rows[0] || ''
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -392,7 +544,9 @@ Page({
|
|||||||
selectEquipment: e.currentTarget.dataset.item,
|
selectEquipment: e.currentTarget.dataset.item,
|
||||||
name: e.currentTarget.dataset.item.customer_name,
|
name: e.currentTarget.dataset.item.customer_name,
|
||||||
phone: e.currentTarget.dataset.item.customer_phone,
|
phone: e.currentTarget.dataset.item.customer_phone,
|
||||||
equipmentShow: false
|
address:e.currentTarget.dataset.item.address,
|
||||||
|
region:e.currentTarget.dataset.item.region,
|
||||||
|
equipmentShow: false,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -24,6 +24,21 @@
|
|||||||
<input type="number" maxlength="11" placeholder="请填写您的联系电话" placeholder-class="information_ipt_pla" value="{{phone}}" bindinput="ipt2" />
|
<input type="number" maxlength="11" placeholder="请填写您的联系电话" placeholder-class="information_ipt_pla" value="{{phone}}" bindinput="ipt2" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<view class="information_row">
|
||||||
|
<view class="information_tit">省市区</view>
|
||||||
|
<view class="information_ipt">
|
||||||
|
<input type="number" bind:tap="choseRegion" disabled placeholder="请选择省市区" placeholder-class="information_ipt_pla" value="{{region}}" bindinput="ipt2" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="information_row">
|
||||||
|
<view class="information_tit">详细地址</view>
|
||||||
|
<view class="information_ipt">
|
||||||
|
<input type="text" placeholder="请填写您的详细地址" placeholder-class="information_ipt_pla" value="{{address}}" bindinput="ipt4" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<view class="information_row noneBorder">
|
<view class="information_row noneBorder">
|
||||||
<view class="information_tit">期望上门时间</view>
|
<view class="information_tit">期望上门时间</view>
|
||||||
|
|
||||||
@ -46,12 +61,7 @@
|
|||||||
<view class="uploadImg">
|
<view class="uploadImg">
|
||||||
<view class="title">图片上传</view>
|
<view class="title">图片上传</view>
|
||||||
<view style="margin-top: 20rpx;">
|
<view style="margin-top: 20rpx;">
|
||||||
<van-uploader file-list="{{ fileList }}"
|
<van-uploader file-list="{{ fileList }}" max-count="1" before-read="beforeRead" bind:after-read="beforeRead" bind:delete="deleteImg" upload-icon="plus" />
|
||||||
max-count="1"
|
|
||||||
before-read="beforeRead"
|
|
||||||
bind:after-read="beforeRead"
|
|
||||||
bind:delete="deleteImg"
|
|
||||||
upload-icon="plus" />
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
@ -64,40 +74,41 @@
|
|||||||
<view wx:if="{{sucess}}" class="sucess">
|
<view wx:if="{{sucess}}" class="sucess">
|
||||||
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/maintenance_sucess.png" mode="widthFix" id="sucess" />
|
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/maintenance_sucess.png" mode="widthFix" id="sucess" />
|
||||||
<view class="sucess_msgTit">提交成功</view>
|
<view class="sucess_msgTit">提交成功</view>
|
||||||
<!-- <view class="sucess_msg">1条报修内容已提交成功</view> -->
|
|
||||||
<!-- <image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/maintennace_msg.png" mode="widthFix" id="msg"/> -->
|
|
||||||
<!-- <view id="msg" bindtap="headerLookClick">
|
|
||||||
查看报修详情>>
|
|
||||||
</view> -->
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<van-popup show="{{ DoorTimeShow }}" close-on-click-overlay position="bottom" custom-style="height: 40%;" bind:close="onClose">
|
<van-popup show="{{ DoorTimeShow }}" close-on-click-overlay position="bottom" custom-style="height: 40%;" bind:close="onClose">
|
||||||
<van-datetime-picker
|
<van-datetime-picker formatter="{{ formatter }}" type="datetime" min-date="{{ minDate }}" bind:confirm="onInput" bind:cancel="onClose" />
|
||||||
formatter="{{ formatter }}"
|
|
||||||
type="datetime"
|
|
||||||
min-date="{{ minDate }}"
|
|
||||||
bind:confirm="onInput"
|
|
||||||
bind:cancel="onClose"
|
|
||||||
/>
|
|
||||||
</van-popup>
|
</van-popup>
|
||||||
|
|
||||||
<van-popup
|
<van-popup show="{{ equipmentShow }}" close-on-click-overlay position="bottom" round custom-style="height: 40%;" bind:close="onClosePopup">
|
||||||
show="{{ equipmentShow }}"
|
|
||||||
close-on-click-overlay
|
|
||||||
position="bottom"
|
|
||||||
round
|
|
||||||
custom-style="height: 40%;"
|
|
||||||
bind:close="onClosePopup"
|
|
||||||
>
|
|
||||||
<view class="equipment">
|
<view class="equipment">
|
||||||
<view class="equipment_title" bindtap="headerCancelClick">
|
<view class="equipment_title" bindtap="headerCancelClick">
|
||||||
<text>取消</text>
|
<text>取消</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="equip_item {{index === equipmentList.length -1 && 'no_bottom'}}" wx:for="{{equipmentList}}" wx:key="index" bindtap="headerSelectClick" data-item="{{item}}">
|
<view class="equip_item {{index === equipmentList.length -1 && 'no_bottom'}}" wx:for="{{equipmentList}}" wx:key="index" bindtap="headerSelectClick" data-item="{{item}}">
|
||||||
<image class="equip_pic" src="{{item.product_icon}}" mode=""/>
|
<image class="equip_pic" src="{{item.product_icon}}" mode="" />
|
||||||
<view class="equip_desc">{{item.device_code}}</view>
|
<view class="equip_desc">{{item.device_code}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</van-popup>
|
</van-popup>
|
||||||
|
|
||||||
|
<!-- 省市区 -->
|
||||||
|
<van-popup show="{{ show2 }}" custom-style="height: 40%;" safe-area-inset-bottom lock-scroll bind:close="onClose2" round close-on-click-overlay position="bottom">
|
||||||
|
<view class="popup_title">
|
||||||
|
<view class="popup_label" bind:tap="onClose2">取消</view>
|
||||||
|
<view class="popup_label color_blue" bind:tap="onOk">确认</view>
|
||||||
|
</view>
|
||||||
|
<picker-view indicator-style="height: 50px;" style="width: 100%; height: 500rpx;" value="{{value}}" bindchange="bindChange">
|
||||||
|
<picker-view-column>
|
||||||
|
<view wx:for="{{cityList}}" wx:key="index" style="line-height: 50px; text-align: center;">{{item.name}}</view>
|
||||||
|
</picker-view-column>
|
||||||
|
<picker-view-column>
|
||||||
|
<view wx:for="{{newAreaList}}" wx:key="index" style="line-height: 50px; text-align: center;">{{item.name}}</view>
|
||||||
|
</picker-view-column>
|
||||||
|
<picker-view-column>
|
||||||
|
<view wx:for="{{newBusiness}}" wx:key="index" style="line-height: 50px; text-align: center;">{{item.business_name}}</view>
|
||||||
|
</picker-view-column>
|
||||||
|
</picker-view>
|
||||||
|
</van-popup>
|
||||||
@ -212,3 +212,17 @@
|
|||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.popup_title {
|
||||||
|
display: flex;
|
||||||
|
margin: 20rpx 30rpx 0;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.popup_label {
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
.color_blue {
|
||||||
|
color: #576b95;
|
||||||
|
}
|
||||||
@ -1,6 +1,8 @@
|
|||||||
let util = require('../../../../utils/util')
|
let util = require('../../../../utils/util')
|
||||||
let apiArr = require('../../../../api/water_filter')
|
let apiArr = require('../../../../api/water_filter')
|
||||||
let apiArr2 = require('../../../../api/partner')
|
let apiArr2 = require('../../../../api/partner')
|
||||||
|
const app = getApp({ allowDefault: true })
|
||||||
|
|
||||||
// packages/WaterPurifier/pages/upKeep/upKeep.js
|
// packages/WaterPurifier/pages/upKeep/upKeep.js
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
@ -8,6 +10,10 @@ Page({
|
|||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
|
s: app.system.statusBarHeight, // 状态栏高度
|
||||||
|
n: (app.menu.top - app.system.statusBarHeight) * 2 + app.menu.height, // 导航栏高度
|
||||||
|
t: app.menu.top, // 胶囊局顶部距离
|
||||||
|
h: app.menu.height, // 胶囊高度
|
||||||
stateType: {
|
stateType: {
|
||||||
1: '待分配',
|
1: '待分配',
|
||||||
2: '维修中',
|
2: '维修中',
|
||||||
@ -22,42 +28,54 @@ Page({
|
|||||||
{ text: '已撤销', value: 4 },
|
{ text: '已撤销', value: 4 },
|
||||||
],
|
],
|
||||||
value1: 0,
|
value1: 0,
|
||||||
show:false,
|
show: false,
|
||||||
MasterList:[],
|
MasterList: [],
|
||||||
orderList:[],
|
orderList: [],
|
||||||
page_num:1,
|
page_num: 1,
|
||||||
page_size:10,
|
page_size: 10,
|
||||||
total:'',
|
total: '',
|
||||||
flag:false,
|
flag: false,
|
||||||
sendOrders: {},
|
sendOrders: {},
|
||||||
|
searchText: "",
|
||||||
},
|
},
|
||||||
|
back(){
|
||||||
onClose(){
|
wx.reLaunch({
|
||||||
let that = this
|
url: '/packages/partner/pages/partner',
|
||||||
that.setData({
|
|
||||||
show:false
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
dispatch(e){
|
ipt1(e) {
|
||||||
|
let that = this
|
||||||
|
console.log(e);
|
||||||
|
that.setData({
|
||||||
|
searchText: e.detail.value,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onClose() {
|
||||||
let that = this
|
let that = this
|
||||||
that.setData({
|
that.setData({
|
||||||
show:true,
|
show: false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
dispatch(e) {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
show: true,
|
||||||
sendOrders: e.currentTarget.dataset.item
|
sendOrders: e.currentTarget.dataset.item
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
addOrder(){
|
addOrder() {
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: '/packages/partner/pages/addNewOrder/addNewOrder',
|
url: '/packages/partner/pages/addNewOrder/addNewOrder',
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
desc(e){
|
desc(e) {
|
||||||
let that = this
|
let that = this
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: `/packages/partner/pages/orderDesc/orderDesc?install_id=${e.currentTarget.dataset.id}&type=repair`,
|
url: `/packages/partner/pages/OrderMsgInfo/OrderMsgInfo?id=${e.currentTarget.dataset.id}&type=1`,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
headerDropdownClick(e) {
|
headerDropdownClick(e) {
|
||||||
this.setData({
|
this.setData({
|
||||||
@ -78,10 +96,10 @@ Page({
|
|||||||
mask: true
|
mask: true
|
||||||
})
|
})
|
||||||
|
|
||||||
util.postUrl4(apiArr.RecallRepair,{
|
util.postUrl4(apiArr.RecallRepair, {
|
||||||
status: 4,
|
status: 4,
|
||||||
repair_id: item.repair_id,
|
repair_id: item.repair_id,
|
||||||
},res=>{
|
}, res => {
|
||||||
wx.hideLoading()
|
wx.hideLoading()
|
||||||
if (res.error) {
|
if (res.error) {
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
@ -98,7 +116,7 @@ Page({
|
|||||||
_this.setData({
|
_this.setData({
|
||||||
orderList: [],
|
orderList: [],
|
||||||
page_num: 1,
|
page_num: 1,
|
||||||
flag:false
|
flag: false
|
||||||
})
|
})
|
||||||
_this.getOrderList();
|
_this.getOrderList();
|
||||||
}, 2000)
|
}, 2000)
|
||||||
@ -106,8 +124,14 @@ Page({
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
search() {
|
||||||
getOrderList(name){
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
orderList: []
|
||||||
|
})
|
||||||
|
this.getOrderList();
|
||||||
|
},
|
||||||
|
getOrderList(name) {
|
||||||
let that = this
|
let that = this
|
||||||
//设置加载状态
|
//设置加载状态
|
||||||
wx.showLoading({
|
wx.showLoading({
|
||||||
@ -117,30 +141,31 @@ Page({
|
|||||||
|
|
||||||
let admin = wx.getStorageSync('admin')
|
let admin = wx.getStorageSync('admin')
|
||||||
let param = {
|
let param = {
|
||||||
status:that.data.value1,
|
status: that.data.value1,
|
||||||
page_num:that.data.page_num,
|
page_num: that.data.page_num,
|
||||||
page_size:that.data.page_size,
|
page_size: that.data.page_size,
|
||||||
dealer_id:admin.shop_id
|
dealer_id: admin.shop_id,
|
||||||
|
search: that.data.searchText,
|
||||||
};
|
};
|
||||||
if(name) {
|
if (name) {
|
||||||
param = {
|
param = {
|
||||||
...param,
|
...param,
|
||||||
customer_name: name
|
customer_name: name
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
util.postUrl4(apiArr2.getOrderPairList,param,res=>{
|
util.postUrl4(apiArr2.getOrderPairList, param, res => {
|
||||||
console.log('rererererererere', res);
|
console.log('rererererererere', res);
|
||||||
wx.hideLoading()
|
wx.hideLoading()
|
||||||
let flag = false
|
let flag = false
|
||||||
if(res.rows.length == that.data.page_size){
|
if (res.rows.length == that.data.page_size) {
|
||||||
flag = true
|
flag = true
|
||||||
}else{
|
} else {
|
||||||
flag = false
|
flag = false
|
||||||
}
|
}
|
||||||
that.setData({
|
that.setData({
|
||||||
orderList:that.data.orderList.concat(res.rows || []),
|
orderList: that.data.orderList.concat(res.rows || []),
|
||||||
page_num:that.data.page_num+1,
|
page_num: that.data.page_num + 1,
|
||||||
flag
|
flag
|
||||||
})
|
})
|
||||||
console.log(that.data.flag);
|
console.log(that.data.flag);
|
||||||
@ -150,65 +175,64 @@ Page({
|
|||||||
headerInputClick(e) {
|
headerInputClick(e) {
|
||||||
const that = this;
|
const that = this;
|
||||||
that.setData({
|
that.setData({
|
||||||
orderList:[],
|
orderList: [],
|
||||||
page_num: 1,
|
page_num: 1,
|
||||||
flag:false
|
flag: false
|
||||||
}, () => {
|
}, () => {
|
||||||
this.getOrderList(e.detail.value);
|
this.getOrderList(e.detail.value);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
//师傅列表
|
//师傅列表
|
||||||
getMasterList(){
|
getMasterList() {
|
||||||
let that = this
|
let that = this
|
||||||
wx.showLoading({
|
wx.showLoading({
|
||||||
title: '加载中...',
|
title: '加载中...',
|
||||||
mask: true
|
mask: true
|
||||||
})
|
})
|
||||||
|
|
||||||
util.postUrl4(apiArr.MasterList,{
|
util.postUrl4(apiArr.MasterList, {
|
||||||
page_num:1,
|
page_num: 1,
|
||||||
page_size:100,
|
page_size: 100,
|
||||||
dealer_id:wx.getStorageSync('dealer_id')
|
dealer_id: wx.getStorageSync('dealer_id')
|
||||||
},res=>{
|
}, res => {
|
||||||
wx.hideLoading()
|
wx.hideLoading()
|
||||||
res.rows.forEach(item=>{
|
res.rows.forEach(item => {
|
||||||
item.avatar = util.img_url + item.avatar
|
item.avatar = util.img_url + item.avatar
|
||||||
})
|
})
|
||||||
|
|
||||||
that.setData({
|
that.setData({
|
||||||
MasterList:res.rows
|
MasterList: res.rows
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//选择师傅
|
//选择师傅
|
||||||
selectMaster(e){
|
selectMaster(e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
let that = this
|
let that = this
|
||||||
let MasterList = that.data.MasterList
|
let MasterList = that.data.MasterList
|
||||||
MasterList.forEach(item=>{
|
MasterList.forEach(item => {
|
||||||
item.checked = false
|
item.checked = false
|
||||||
})
|
})
|
||||||
MasterList[e.currentTarget.dataset.index].checked = true
|
MasterList[e.currentTarget.dataset.index].checked = true
|
||||||
that.setData({
|
that.setData({
|
||||||
MasterList
|
MasterList
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//确定
|
//确定
|
||||||
sure(){
|
sure() {
|
||||||
let that = this
|
let that = this
|
||||||
const { sendOrders, MasterList } = this.data;
|
const { sendOrders, MasterList } = this.data;
|
||||||
const checkedMaster = MasterList.filter((item) => item.checked)[0];
|
const checkedMaster = MasterList.filter((item) => item.checked)[0];
|
||||||
console.log('sendOrders', sendOrders);
|
console.log('sendOrders', sendOrders);
|
||||||
console.log('checkedMaster', checkedMaster);
|
console.log('checkedMaster', checkedMaster);
|
||||||
that.setData({
|
that.setData({
|
||||||
show:false
|
show: false
|
||||||
})
|
})
|
||||||
util.postUrl4(apiArr.orderRepairAssign,{
|
util.postUrl4(apiArr2.assignRepairMaster, {
|
||||||
master_id: checkedMaster.info_id,
|
master_id: checkedMaster.info_id,
|
||||||
repair_id: sendOrders.repair_id,
|
repair_id: sendOrders.repair_id,
|
||||||
dealer_id: Number(wx.getStorageSync('dealer_id'))
|
}, res => {
|
||||||
},res=>{
|
|
||||||
if (res.error) {
|
if (res.error) {
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
title: '派单失败',
|
title: '派单失败',
|
||||||
@ -222,25 +246,25 @@ sure(){
|
|||||||
success() {
|
success() {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
that.setData({
|
that.setData({
|
||||||
flag:false,
|
flag: false,
|
||||||
page_num:1,
|
page_num: 1,
|
||||||
orderList:[]
|
orderList: []
|
||||||
})
|
})
|
||||||
that.getOrderList()
|
that.getOrderList()
|
||||||
}, 1500)
|
}, 1500)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
let that =this
|
let that = this
|
||||||
// that.getFootNav()
|
// that.getFootNav()
|
||||||
// that.getOrderList()
|
// that.getOrderList()
|
||||||
// that.getMasterList()
|
that.getMasterList()
|
||||||
wx.showShareMenu({
|
wx.showShareMenu({
|
||||||
withShareTicket: true,
|
withShareTicket: true,
|
||||||
menus: ['shareAppMessage', 'shareTimeline']
|
menus: ['shareAppMessage', 'shareTimeline']
|
||||||
@ -263,7 +287,6 @@ sure(){
|
|||||||
orderList: [],
|
orderList: [],
|
||||||
})
|
})
|
||||||
this.getOrderList()
|
this.getOrderList()
|
||||||
this.getMasterList()
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -284,7 +307,14 @@ sure(){
|
|||||||
* 页面相关事件处理函数--监听用户下拉动作
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
*/
|
*/
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
page_num: 1,
|
||||||
|
orderList: [],
|
||||||
|
flag: false
|
||||||
|
})
|
||||||
|
that.getOrderList()
|
||||||
|
wx.stopPullDownRefresh();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -292,8 +322,8 @@ sure(){
|
|||||||
*/
|
*/
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
let that = this
|
let that = this
|
||||||
console.log(123,that.data.flag);
|
console.log(123, that.data.flag);
|
||||||
if(that.data.flag){
|
if (that.data.flag) {
|
||||||
this.getOrderList()
|
this.getOrderList()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -301,18 +331,18 @@ sure(){
|
|||||||
/**
|
/**
|
||||||
* 用户点击右上角分享
|
* 用户点击右上角分享
|
||||||
*/
|
*/
|
||||||
onShareAppMessage(){
|
onShareAppMessage() {
|
||||||
return {
|
return {
|
||||||
title: '人人爱净水', // 分享卡片标题(必填)
|
title: '人人爱净水', // 分享卡片标题(必填)
|
||||||
path: '/pages/water_filter/water_filter', // 用户点击后跳转的路径(可选,默认当前页)
|
path: '/pages/water_filter/water_filter', // 用户点击后跳转的路径(可选,默认当前页)
|
||||||
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义图片(可选,比例建议 5:4)
|
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义图片(可选,比例建议 5:4)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShareTimeline() {
|
onShareTimeline() {
|
||||||
return {
|
return {
|
||||||
title: '人人爱净水', // 自定义标题
|
title: '人人爱净水', // 自定义标题
|
||||||
query: '', // 自定义页面路径中的参数
|
query: '', // 自定义页面路径中的参数
|
||||||
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义分享图片路径
|
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义分享图片路径
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ -2,5 +2,6 @@
|
|||||||
"usingComponents": {
|
"usingComponents": {
|
||||||
"Footer":"/component/footer/index"
|
"Footer":"/component/footer/index"
|
||||||
},
|
},
|
||||||
"navigationBarTitleText": "维修工单"
|
"enablePullDownRefresh": true,
|
||||||
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
@ -1,11 +1,30 @@
|
|||||||
<view class="upkeep">
|
<view class="upkeep">
|
||||||
|
|
||||||
|
|
||||||
|
<view class="nav-box" style="padding-top: {{ t }}px;">
|
||||||
|
<view class="nav-bar" style="height: {{ h }}px;">
|
||||||
|
<view class="nav-bar-left" bind:tap="back">
|
||||||
|
<van-icon name="arrow-left" size="24px" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="nav-bar-title" style="height: {{ h }}px;line-height: {{ h }}px;color: {{color}};font-size: 28rpx;">
|
||||||
|
维修工单
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="nav-bar-right">
|
||||||
|
<van-icon name="arrow-left" size="24px" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<view class="upkeep_select">
|
<view class="upkeep_select">
|
||||||
<view class="ipt">
|
<view class="ipt">
|
||||||
<input type="text" placeholder="请输入客户姓名" placeholder-style="color: #999999;font-size: 24rpx;" bind:input="headerInputClick" />
|
<input value="{{searchText}}" confirm-type="search" bindconfirm="search" bindinput="ipt1" type="text" placeholder="设备编号/客户名称/客户手机/客户地址" placeholder-style="color: #999999;font-size: 28rpx;" />
|
||||||
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/dervice/deriveSearch.png?1" mode="widthFix " />
|
|
||||||
|
<view class="searchBox" bind:tap="search">
|
||||||
|
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/dervice/deriveSearch.png?1" mode="widthFix" />
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
新增
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="down">
|
<view class="down">
|
||||||
@ -25,8 +44,9 @@
|
|||||||
<view class="orderList">
|
<view class="orderList">
|
||||||
<view class="orderItem" wx:if="{{orderList.length>0}}" bind:tap="desc" data-id="{{item.repair_id}}" wx:for="{{orderList}}" wx:key="index">
|
<view class="orderItem" wx:if="{{orderList.length>0}}" bind:tap="desc" data-id="{{item.repair_id}}" wx:for="{{orderList}}" wx:key="index">
|
||||||
<view class="orderItem_tit">工单号:{{item.repair_no}}</view>
|
<view class="orderItem_tit">工单号:{{item.repair_no}}</view>
|
||||||
|
|
||||||
<view class="orderItem_Item">
|
<view class="orderItem_Item">
|
||||||
<view class="orderItem_Item_tit">设备号</view>
|
<view class="orderItem_Item_tit">设备编号</view>
|
||||||
<view class="orderItem_Item_con">{{item.device_code}}</view>
|
<view class="orderItem_Item_con">{{item.device_code}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="orderItem_Item">
|
<view class="orderItem_Item">
|
||||||
@ -50,14 +70,13 @@
|
|||||||
<view class="orderItem_Item_con">{{item.fault_desc}}</view>
|
<view class="orderItem_Item_con">{{item.fault_desc}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="orderItem_Item">
|
<view class="orderItem_Item">
|
||||||
<view class="orderItem_Item_tit">具体位置</view>
|
<view class="orderItem_Item_tit">详细地址</view>
|
||||||
<view class="orderItem_Item_con">{{item.region + item.address}}</view>
|
<view class="orderItem_Item_con">{{item.region + item.address || "暂无数据"}}</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="contral">
|
<view class="contral">
|
||||||
<view class="state state2" catchtap="headerRecallClick" data-item="{{item}}" wx:if="{{item.status === 1}}">撤回</view>
|
<view class="state state2" catchtap="headerRecallClick" data-item="{{item}}" wx:if="{{item.status === 1}}">撤回</view>
|
||||||
<view class="state" wx:if="{{item.status === 1}}" data-item="{{item}}" catch:tap="dispatch">派单</view>
|
<view class="state" wx:if="{{item.status === 1}}" data-item="{{item}}" catch:tap="dispatch">派单</view>
|
||||||
<!-- <view class="state state3" catch:tap="headerOkClick" wx:if="{{item.status === 3}}">完成</view> -->
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,11 @@
|
|||||||
.upkeep{
|
.upkeep{
|
||||||
}
|
}
|
||||||
|
.nav-box{
|
||||||
|
padding-bottom: 30rpx;
|
||||||
|
}
|
||||||
|
.nav-bar-right{
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
.upkeep_select {
|
.upkeep_select {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -8,16 +14,20 @@
|
|||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
color: #222222;
|
color: #222222;
|
||||||
background-color: #F9F9F9;
|
background-color: #F9F9F9;
|
||||||
padding: 30rpx 20rpx;
|
padding: 16rpx 20rpx;
|
||||||
|
}
|
||||||
|
.ipt input{
|
||||||
|
flex: 1;
|
||||||
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.upkeep_select .ipt {
|
.upkeep_select .ipt {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
width: 623rpx;
|
width: 710rpx;
|
||||||
height: 54rpx;
|
height: 98rpx;
|
||||||
|
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
border-radius: 100rpx 100rpx 100rpx 100rpx;
|
border-radius: 100rpx 100rpx 100rpx 100rpx;
|
||||||
padding-left: 26rpx;
|
padding-left: 26rpx;
|
||||||
@ -25,8 +35,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.ipt image {
|
.ipt image {
|
||||||
width: 30rpx;
|
width: 42rpx;
|
||||||
height: 30rpx;
|
height: 42rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.orderList {
|
.orderList {
|
||||||
@ -54,7 +64,7 @@
|
|||||||
|
|
||||||
.orderItem_Item_tit {
|
.orderItem_Item_tit {
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 26rpx;
|
font-size: 28rpx;
|
||||||
color: #999999;
|
color: #999999;
|
||||||
min-width: 110rpx;
|
min-width: 110rpx;
|
||||||
margin-right: 30rpx;
|
margin-right: 30rpx;
|
||||||
@ -62,7 +72,7 @@
|
|||||||
|
|
||||||
.orderItem_Item_con {
|
.orderItem_Item_con {
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 26rpx;
|
font-size: 28rpx;
|
||||||
color: #222222;
|
color: #222222;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,3 +247,11 @@
|
|||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
height: 100% !important;
|
height: 100% !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.searchBox{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding-left: 40rpx;
|
||||||
|
}
|
||||||
@ -43,7 +43,7 @@ Page({
|
|||||||
loginOut(){
|
loginOut(){
|
||||||
wx.removeStorageSync('is_master')
|
wx.removeStorageSync('is_master')
|
||||||
wx.redirectTo({
|
wx.redirectTo({
|
||||||
url:"/pages/chooseEntrance/chooseEntrance"
|
url:"/pages/newLogin/newLogin"
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -70,8 +70,10 @@ Page({
|
|||||||
})
|
})
|
||||||
|
|
||||||
if (res.avatar) {
|
if (res.avatar) {
|
||||||
|
let avatarUrl = res.avatar.startsWith('http')? res.avatar : util.img_url + res.avatar
|
||||||
|
console.log(res.avatar.startsWith('http'));
|
||||||
that.setData({
|
that.setData({
|
||||||
avatarUrl: util.img_url + res.avatar
|
avatarUrl
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -27,9 +27,9 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="btn" bind:tap="deviceList">
|
<!-- <view class="btn" bind:tap="deviceList">
|
||||||
设备管理
|
设备管理
|
||||||
</view>
|
</view> -->
|
||||||
|
|
||||||
|
|
||||||
<view class="btn" bind:tap="SubscribeMessage">
|
<view class="btn" bind:tap="SubscribeMessage">
|
||||||
|
|||||||
394
packages/master/addNewOrder/index.js
Normal file
394
packages/master/addNewOrder/index.js
Normal file
@ -0,0 +1,394 @@
|
|||||||
|
let util = require('../../../utils/util')
|
||||||
|
let apiArr = require('../../../api/partner')
|
||||||
|
let apiArr2 = require('../../../api/water_filter')
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
fileList: [],
|
||||||
|
fileList2: [],
|
||||||
|
device_code: "",
|
||||||
|
customer_name: "",
|
||||||
|
customer_phone: "",
|
||||||
|
region: "",
|
||||||
|
address: "",
|
||||||
|
deviceList: [],
|
||||||
|
fault_desc: "",
|
||||||
|
page_num: 1,
|
||||||
|
page_size: 50,
|
||||||
|
show: false,
|
||||||
|
currentDeviceInfo: {
|
||||||
|
region:"",
|
||||||
|
address:"",
|
||||||
|
},
|
||||||
|
formatter(type, value) {
|
||||||
|
if (type === 'year') {
|
||||||
|
return `${value}年`;
|
||||||
|
}
|
||||||
|
if (type === 'month') {
|
||||||
|
return `${value}月`;
|
||||||
|
}
|
||||||
|
if (type === 'day') {
|
||||||
|
return `${value}日`;
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
},
|
||||||
|
show2: false,
|
||||||
|
cityList: [],
|
||||||
|
areaList: [],
|
||||||
|
businessList: [],
|
||||||
|
newAreaList: [], // 默认展示 市区
|
||||||
|
newBusiness: [], // 默认展示 县/区
|
||||||
|
confirmCity: '',
|
||||||
|
confirmArea: '',
|
||||||
|
confirmBusiness: '',
|
||||||
|
deviceInfo:{
|
||||||
|
customer_name:"",
|
||||||
|
customer_phone:"",
|
||||||
|
device_code:"",
|
||||||
|
address:"",
|
||||||
|
region:""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onClose2() {
|
||||||
|
this.setData({
|
||||||
|
show2: false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
headerAreaClick() {
|
||||||
|
this.setData({
|
||||||
|
show2: true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
bindChange(e) {
|
||||||
|
const { value } = e.detail;
|
||||||
|
const { cityList, areaList, businessList } = this.data;
|
||||||
|
// 每次切换时,根据当前点击的省过滤出所属市区,并且试试变化县/区
|
||||||
|
let newArea = areaList.filter((item) => item.city_id === cityList[value[0]].city_id);
|
||||||
|
let newbus = businessList.filter((item) => item.area_id === newArea[value[1]].area_id);
|
||||||
|
this.setData({
|
||||||
|
newAreaList: newArea,
|
||||||
|
newBusiness: newbus,
|
||||||
|
confirmCity: cityList[value[0]],
|
||||||
|
confirmArea: newArea[value[1]],
|
||||||
|
confirmBusiness: newbus[value[2]],
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
onOk() {
|
||||||
|
const { confirmCity, confirmArea, confirmBusiness } = this.data;
|
||||||
|
console.log(confirmCity, confirmArea, confirmBusiness);
|
||||||
|
this.setData({
|
||||||
|
show2: false,
|
||||||
|
"currentDeviceInfo.region": `${confirmCity.name}${confirmArea.area_name}${confirmBusiness.business_name}`,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
getSSQ() {
|
||||||
|
let that = this
|
||||||
|
util.postUrl2(apiArr2.city, {}, res => {
|
||||||
|
util.postUrl2(apiArr2.area, {}, res1 => {
|
||||||
|
util.postUrl2(apiArr2.business, {}, res2 => {
|
||||||
|
wx.hideLoading();
|
||||||
|
// 省列表来自 res
|
||||||
|
let cityList = res.data.data.rows;
|
||||||
|
// 市列表来自 res1
|
||||||
|
let areaList = res1.data.data.rows;
|
||||||
|
// 区列表来自 res2
|
||||||
|
let businessList = res2.data.data.rows;
|
||||||
|
|
||||||
|
// 处理市列表,将衡水市放到最后
|
||||||
|
let hengshuiIndex = areaList.findIndex(item => item.name === '衡水市');
|
||||||
|
console.log(hengshuiIndex, 'hengshuiIndex');
|
||||||
|
if (hengshuiIndex !== -1) {
|
||||||
|
const hengshui = areaList.splice(hengshuiIndex, 1)[0];
|
||||||
|
areaList.push(hengshui);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(businessList);
|
||||||
|
// 处理区列表,将衡水市的桃城区放到最后一个
|
||||||
|
let taochengIndex = businessList.findIndex(item => item.business_name === '桃城区');
|
||||||
|
if (taochengIndex !== -1) {
|
||||||
|
const taocheng = businessList.splice(taochengIndex, 1)[0];
|
||||||
|
businessList.unshift(taocheng);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 默认展示第一条数据的省、市和区
|
||||||
|
let newArea = res1.data.data.rows.filter((item) => {
|
||||||
|
return item.city_id === res.data.data.rows[0].city_id
|
||||||
|
});
|
||||||
|
let newbus = res2.data.data.rows.filter((item) => {
|
||||||
|
return item.area_id === res1.data.data.rows[0].area_id
|
||||||
|
});
|
||||||
|
|
||||||
|
// 正确存储数据
|
||||||
|
wx.setStorageSync('cityList', cityList)
|
||||||
|
wx.setStorageSync('areaList', areaList)
|
||||||
|
wx.setStorageSync('businessList', businessList)
|
||||||
|
|
||||||
|
this.setData({
|
||||||
|
cityList: cityList,
|
||||||
|
areaList: areaList,
|
||||||
|
businessList: businessList,
|
||||||
|
newAreaList: newArea, // 默认展示市
|
||||||
|
newBusiness: newbus, // 默认展示区
|
||||||
|
confirmCity: cityList[0],
|
||||||
|
confirmArea: newArea[0],
|
||||||
|
confirmBusiness: newbus[0],
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeShow1() {
|
||||||
|
let that = this
|
||||||
|
// wx.navigateTo({
|
||||||
|
// url: '/packages/partner/pages/chooseRepairDevice/chooseRepairDevice',
|
||||||
|
// })
|
||||||
|
that.setData({
|
||||||
|
show:true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getDeviceList() {
|
||||||
|
let that = this
|
||||||
|
util.postUrl(apiArr2.masterDeviceList, {
|
||||||
|
page_num: that.data.page_num,
|
||||||
|
page_size: that.data.page_size,
|
||||||
|
info_id:wx.getStorageSync('info_id')
|
||||||
|
}, res => {
|
||||||
|
that.setData({
|
||||||
|
deviceList: res.rows
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
changeAddress(e){
|
||||||
|
console.log(e);
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
"currentDeviceInfo.address":e.detail.value
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
updateFault_desc(e) {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
fault_desc: e.detail.value
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
confirmPackage(e) {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
show: false,
|
||||||
|
// currentDeviceInfo: e.detail.value,
|
||||||
|
device_code: e.detail.value.device_code
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onClose() {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
show: false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
beforeRead(e) {
|
||||||
|
let that = this
|
||||||
|
wx.showLoading({
|
||||||
|
title: '上传中',
|
||||||
|
mask: true,
|
||||||
|
})
|
||||||
|
util.uploadFileUrl(e.detail.file.url, (res) => {
|
||||||
|
wx.hideLoading()
|
||||||
|
let datas = JSON.parse(res)
|
||||||
|
console.log(datas.data);
|
||||||
|
let url = util.img_url + datas.data.path
|
||||||
|
let fileList = that.data.fileList
|
||||||
|
let fileList2 = that.data.fileList2
|
||||||
|
let obj = {
|
||||||
|
url: url,
|
||||||
|
name: 'avatar'
|
||||||
|
}
|
||||||
|
let obj2 = {
|
||||||
|
url: datas.data.path,
|
||||||
|
name: 'avatar'
|
||||||
|
}
|
||||||
|
fileList.push(obj)
|
||||||
|
fileList2.push(obj2)
|
||||||
|
that.setData({
|
||||||
|
fileList,
|
||||||
|
fileList2
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
deleteImg(e) {
|
||||||
|
console.log(e);
|
||||||
|
let that = this
|
||||||
|
let fileList = that.data.fileList
|
||||||
|
let fileList2 = that.data.fileList2
|
||||||
|
fileList.splice(e.detail.index, 1)
|
||||||
|
fileList2.splice(e.detail.index, 1)
|
||||||
|
that.setData({
|
||||||
|
fileList,
|
||||||
|
fileList2
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeCustomerPhone(e){
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
customer_phone: e.detail.value
|
||||||
|
})
|
||||||
|
if(e.detail.value.length == 11){
|
||||||
|
that.searchCustomer(e.detail.value)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
searchCustomer(e) {
|
||||||
|
let that = this
|
||||||
|
util.postUrl(apiArr.phoneSearch, {
|
||||||
|
phone: e
|
||||||
|
}, res => {
|
||||||
|
console.log(res);
|
||||||
|
if (res.row.length == 1) {
|
||||||
|
that.setData({
|
||||||
|
customer_name: res.row[0].name,
|
||||||
|
address: res.row[0].address,
|
||||||
|
customer_id: res.row[0].info_id,
|
||||||
|
area:res.row[0].region,
|
||||||
|
address:res.row[0].address,
|
||||||
|
customer_phone:res.row[0].phone,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
that.setData({
|
||||||
|
customer_name: '',
|
||||||
|
address: '',
|
||||||
|
customer_id: 0
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
let that = this
|
||||||
|
|
||||||
|
|
||||||
|
if (!that.data.deviceInfo.device_code) {
|
||||||
|
return wx.showToast({
|
||||||
|
title: '请选择维修设备',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (!that.data.fault_desc) {
|
||||||
|
return wx.showToast({
|
||||||
|
title: '请填写故障描述',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!that.data.fileList.length) {
|
||||||
|
return wx.showToast({
|
||||||
|
title: '请上传故障图片',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
util.postUrl(apiArr.createRepairOrder, {
|
||||||
|
device_code: that.data.deviceInfo.device_code,
|
||||||
|
appointment_time: '',
|
||||||
|
fault_desc: that.data.fault_desc,
|
||||||
|
fault_imgs: that.data.fileList2[0].url,
|
||||||
|
info_id:wx.getStorageSync('info_id')
|
||||||
|
}, res => {
|
||||||
|
wx.showToast({
|
||||||
|
title: '创建成功!',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
wx.navigateBack({
|
||||||
|
delta: 1
|
||||||
|
})
|
||||||
|
}, 1500)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
let that = this
|
||||||
|
that.getDeviceList()
|
||||||
|
if (wx.getStorageSync('cityList') && wx.getStorageSync('areaList') && wx.getStorageSync('businessList')) {
|
||||||
|
let res = wx.getStorageSync('cityList')
|
||||||
|
let res1 = wx.getStorageSync('areaList')
|
||||||
|
let res2 = wx.getStorageSync('businessList')
|
||||||
|
console.log(res1);
|
||||||
|
// 默认展示第一条数据 的市区 和 城区
|
||||||
|
let newArea = res1.filter((item) => {
|
||||||
|
return item.city_id === res[0].city_id
|
||||||
|
});
|
||||||
|
let newbus = res2.filter((item) => {
|
||||||
|
return item.area_id === res1[0].area_id
|
||||||
|
});
|
||||||
|
this.setData({
|
||||||
|
cityList: res,
|
||||||
|
areaList: res1,
|
||||||
|
businessList: res2,
|
||||||
|
newAreaList: newArea, // 默认展示 市区
|
||||||
|
newBusiness: newbus, // 默认展示 县/区
|
||||||
|
confirmCity: res1[0],
|
||||||
|
confirmArea: newArea[0],
|
||||||
|
confirmBusiness: newbus[0],
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
that.getSSQ()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
4
packages/master/addNewOrder/index.json
Normal file
4
packages/master/addNewOrder/index.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {},
|
||||||
|
"navigationBarTitleText": "新增维修工单"
|
||||||
|
}
|
||||||
127
packages/master/addNewOrder/index.wxml
Normal file
127
packages/master/addNewOrder/index.wxml
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
<view class="newWorkOrder">
|
||||||
|
<view class="form">
|
||||||
|
|
||||||
|
<view class="formItem">
|
||||||
|
<view class="formItem_tit">
|
||||||
|
<view class="icon">*</view>
|
||||||
|
维修设备
|
||||||
|
</view>
|
||||||
|
<view class="formItem_con" bind:tap="changeShow1">
|
||||||
|
<input type="text" disabled placeholder="请选择维修设备" value="{{device_code}}" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<view class="formItem">
|
||||||
|
<view class="formItem_tit">
|
||||||
|
<view class="icon">*</view>
|
||||||
|
用户姓名
|
||||||
|
</view>
|
||||||
|
<view class="formItem_con">
|
||||||
|
<input type="text" placeholder="请输入用户姓名" bindinput="changeCustomerName" value="{{deviceInfo.customer_name}}" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="formItem">
|
||||||
|
<view class="formItem_tit">
|
||||||
|
<view class="icon">*</view>
|
||||||
|
用户电话
|
||||||
|
</view>
|
||||||
|
<view class="formItem_con">
|
||||||
|
<input type="number" placeholder="请输入用户电话" maxlength="11" bindinput="changeCustomerPhone" value="{{deviceInfo.customer_phone}}" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<view class="formItem">
|
||||||
|
<view class="formItem_tit">
|
||||||
|
<view class="icon">*</view>
|
||||||
|
所在区域
|
||||||
|
</view>
|
||||||
|
<view class="formItem_con" bind:tap="headerAreaClick">
|
||||||
|
<input type="text" value="{{deviceInfo.region}}" placeholder='请选择您所在的区域' placeholder-style="font-size: 26rpx;color:#999" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="formItem">
|
||||||
|
<view class="formItem_tit">
|
||||||
|
<view class="icon">*</view>
|
||||||
|
详细地址
|
||||||
|
</view>
|
||||||
|
<view class="formItem_con">
|
||||||
|
<input type="text" placeholder="请输入详细地址" bindinput="changeAddress" value="{{deviceInfo.address}}" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<view class="formItem">
|
||||||
|
<view class="formItem_tit">
|
||||||
|
<view class="icon">*</view>
|
||||||
|
故障描述
|
||||||
|
</view>
|
||||||
|
<view class="formItem_con">
|
||||||
|
<input type="text" bindinput="updateFault_desc" placeholder="请输入故障描述" value="{{fault_desc}}" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<view class="formItem2">
|
||||||
|
<view class="formItem_tit">
|
||||||
|
<view class="icon">*</view>
|
||||||
|
故障图片
|
||||||
|
</view>
|
||||||
|
<view class="formItem_con2">
|
||||||
|
<van-uploader file-list="{{ fileList }}"
|
||||||
|
max-count="1"
|
||||||
|
before-read="beforeRead"
|
||||||
|
bind:after-read="beforeRead"
|
||||||
|
bind:delete="deleteImg"
|
||||||
|
upload-icon="plus" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<view class="submit" bind:tap="submit">
|
||||||
|
提交
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<van-popup show="{{ show }}" safe-area-inset-bottom lock-scroll bind:close="onClose" round close-on-click-overlay position="bottom">
|
||||||
|
<van-picker show-toolbar bind:cancel="cancel1" bind:confirm="confirmPackage" columns="{{ deviceList }}" value-key="device_code" />
|
||||||
|
</van-popup>
|
||||||
|
|
||||||
|
|
||||||
|
<van-popup show="{{ show3 }}" safe-area-inset-bottom lock-scroll bind:close="onClose3" round close-on-click-overlay position="bottom">
|
||||||
|
<van-picker show-toolbar bind:cancel="cancel1" bind:confirm="confirmPackage3" columns="{{ masterList }}" value-key="name" />
|
||||||
|
</van-popup>
|
||||||
|
|
||||||
|
|
||||||
|
<van-popup show="{{ show4 }}" bind:close="onClose4" safe-area-inset-bottom position="bottom" close-on-click-overlay>
|
||||||
|
<van-datetime-picker bind:cancel="onClose4" formatter="{{ formatter }}" type="datetime" min-date="{{ minDate }}" bind:confirm="onInput" />
|
||||||
|
</van-popup>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 省市区选择 -->
|
||||||
|
<van-popup show="{{ show2 }}" custom-style="height: 40%;" safe-area-inset-bottom lock-scroll bind:close="onClose2" round close-on-click-overlay position="bottom">
|
||||||
|
<view class="popup_title">
|
||||||
|
<view class="popup_label" bind:tap="onClose2">取消</view>
|
||||||
|
<view class="popup_label color_blue" bind:tap="onOk">确认</view>
|
||||||
|
</view>
|
||||||
|
<picker-view indicator-style="height: 50px;" style="width: 100%; height: 500rpx;" value="{{value}}" bindchange="bindChange">
|
||||||
|
<picker-view-column>
|
||||||
|
<view wx:for="{{cityList}}" wx:key="index" style="line-height: 50px; text-align: center;">{{item.name}}</view>
|
||||||
|
</picker-view-column>
|
||||||
|
<picker-view-column>
|
||||||
|
<view wx:for="{{newAreaList}}" wx:key="index" style="line-height: 50px; text-align: center;">{{item.name}}</view>
|
||||||
|
</picker-view-column>
|
||||||
|
<picker-view-column>
|
||||||
|
<view wx:for="{{newBusiness}}" wx:key="index" style="line-height: 50px; text-align: center;">{{item.business_name}}</view>
|
||||||
|
</picker-view-column>
|
||||||
|
</picker-view>
|
||||||
|
</van-popup>
|
||||||
88
packages/master/addNewOrder/index.wxss
Normal file
88
packages/master/addNewOrder/index.wxss
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
.newWorkOrder{
|
||||||
|
padding-bottom: 60rpx;
|
||||||
|
}
|
||||||
|
.form {
|
||||||
|
margin: 0 50rpx;
|
||||||
|
margin-top: 12rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formItem {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 30rpx 0;
|
||||||
|
border-bottom: 1rpx solid #E6E6E6;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formItem_tit {
|
||||||
|
display: flex;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #222;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formItem_tit .icon {
|
||||||
|
color: #2583FF;
|
||||||
|
font-size: 26rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formItem_con {
|
||||||
|
text-align: right;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #222222;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formItem_con view {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formItem_con image {
|
||||||
|
width: 13rpx;
|
||||||
|
height: 26rpx;
|
||||||
|
margin-left: 13rpx;
|
||||||
|
}
|
||||||
|
.formItem2{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 30rpx 0;
|
||||||
|
}
|
||||||
|
.formItem_con2{
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
height: 200rpx;
|
||||||
|
}
|
||||||
|
.formItem_con2 textarea{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.submit {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
width: 650rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
background: #2583FF;
|
||||||
|
border-radius: 100rpx 100rpx 100rpx 100rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: 0rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.popup_title {
|
||||||
|
display: flex;
|
||||||
|
margin: 20rpx 30rpx 0;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.popup_label {
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
.color_blue {
|
||||||
|
color: #576b95;
|
||||||
|
}
|
||||||
@ -18,9 +18,9 @@ Page({
|
|||||||
option1: [
|
option1: [
|
||||||
{ text: '全部', value: 0 },
|
{ text: '全部', value: 0 },
|
||||||
{ text: '在用', value: 1 },
|
{ text: '在用', value: 1 },
|
||||||
{ text: '已拆机', value: 2 },
|
{ text: '已拆机', value: 4 },
|
||||||
{ text: '已报废 ', value: 3 },
|
{ text: '已报废 ', value: 7 },
|
||||||
{ text: '已在库', value: 4 },
|
{ text: '已在库', value: 9 },
|
||||||
],
|
],
|
||||||
active: 0,
|
active: 0,
|
||||||
|
|
||||||
|
|||||||
@ -5,23 +5,38 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<view class="device-item" wx:for="{{deviceList}}" wx:key="device_id" data-id="{{item.device_id}}" bind:tap="desc">
|
<view class="device-item" wx:if="{{deviceList.length != 0}}" wx:for="{{deviceList}}" wx:key="device_id" data-id="{{item.device_id}}" bind:tap="desc">
|
||||||
<view class="device-info">
|
<view class="device-info">
|
||||||
<view class="device-field">
|
<view class="device-field">
|
||||||
<label class="field-label">设备名称:</label>
|
<label class="field-label">产品名称:</label>
|
||||||
<text class="field-value">{{item.product_name}}</text>
|
<text class="field-value">{{item.product_name}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="device-field">
|
<view class="device-field">
|
||||||
<label class="field-label">安装师傅:</label>
|
<label class="field-label">设备编号:</label>
|
||||||
|
<text class="field-value">{{item.device_code}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="device-field">
|
||||||
|
<label class="field-label">客户姓名:</label>
|
||||||
<text class="field-value">{{item.customer_name}}</text>
|
<text class="field-value">{{item.customer_name}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="device-field">
|
<view class="device-field">
|
||||||
<label class="field-label">师傅电话:</label>
|
<label class="field-label">客户电话:</label>
|
||||||
<text class="field-value">{{item.customer_phone}}</text>
|
<text class="field-value">{{item.customer_phone}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<view class="device-field">
|
||||||
|
<label class="field-label">师傅姓名:</label>
|
||||||
|
<text class="field-value">{{item.repairman_name}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="device-field">
|
||||||
|
<label class="field-label">师傅电话:</label>
|
||||||
|
<text class="field-value">{{item.repairman_phone}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
<view class="device-field">
|
<view class="device-field">
|
||||||
<label class="field-label">地址:</label>
|
<label class="field-label">地址:</label>
|
||||||
<text class="field-value">{{item.region}} {{item.address}}</text>
|
<text class="field-value">{{item.region}} {{item.address}}</text>
|
||||||
@ -39,7 +54,7 @@
|
|||||||
<text class="field-value" wx:if="{{item.status == 4}}">已拆机</text>
|
<text class="field-value" wx:if="{{item.status == 4}}">已拆机</text>
|
||||||
<text class="field-value" wx:if="{{item.status == 5}}">漏水</text>
|
<text class="field-value" wx:if="{{item.status == 5}}">漏水</text>
|
||||||
<text class="field-value" wx:if="{{item.status == 6}}">制水故障</text>
|
<text class="field-value" wx:if="{{item.status == 6}}">制水故障</text>
|
||||||
<text class="field-value" wx:if="{{item.status == 7}}">报废</text>
|
<text class="field-value" wx:if="{{item.status == 7}}">已报废</text>
|
||||||
<text class="field-value" wx:if="{{item.status == 8}}">已欠费</text>
|
<text class="field-value" wx:if="{{item.status == 8}}">已欠费</text>
|
||||||
<text class="field-value" wx:if="{{item.status == 9}}">在库</text>
|
<text class="field-value" wx:if="{{item.status == 9}}">在库</text>
|
||||||
<text class="field-value" wx:if="{{item.status == 10}}">激活失败</text>
|
<text class="field-value" wx:if="{{item.status == 10}}">激活失败</text>
|
||||||
@ -48,4 +63,6 @@
|
|||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<van-empty wx:if="{{deviceList.length == 0}}" description="暂无内容" />
|
||||||
</view>
|
</view>
|
||||||
@ -187,6 +187,9 @@ Page({
|
|||||||
remark: ''
|
remark: ''
|
||||||
},res=>{
|
},res=>{
|
||||||
console.log(res);
|
console.log(res);
|
||||||
|
wx.navigateTo({
|
||||||
|
url: `/packages/master/orderDesc/index?id=${res.uninstall_id}&type=3`,
|
||||||
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -70,9 +70,8 @@
|
|||||||
<text class="switch-text text-color text-size" wx:if="{{currentDevice.sevice_status == '4'}}">漏水故障</text>
|
<text class="switch-text text-color text-size" wx:if="{{currentDevice.sevice_status == '4'}}">漏水故障</text>
|
||||||
<text class="switch-text text-color text-size" wx:if="{{currentDevice.sevice_status == '5'}}">主板故障</text>
|
<text class="switch-text text-color text-size" wx:if="{{currentDevice.sevice_status == '5'}}">主板故障</text>
|
||||||
|
|
||||||
|
|
||||||
<image wx:if="{{currentDevice.network_status != '1'}}" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/mdicon3.png" mode="" class="wifi-icon" />
|
<image wx:if="{{currentDevice.network_status != '1'}}" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/mdicon3.png" mode="" class="wifi-icon" />
|
||||||
<image wx:if="{{currentDevice.network_status == '1'}}" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/mdicon4.png" mode="" class="wifi-icon" />
|
<image wx:if="{{currentDevice.network_status == 1}}" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/mdicon4.png" mode="" class="wifi-icon" />
|
||||||
<text class="wifi-text text-color text-size">{{currentDevice.network_status == '1'?'在线':'离线'}}</text>
|
<text class="wifi-text text-color text-size">{{currentDevice.network_status == '1'?'在线':'离线'}}</text>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@ -631,14 +631,17 @@
|
|||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
.deleteBtn{
|
.deleteBtn {
|
||||||
width: 100rpx;
|
width: 710rpx;
|
||||||
height: 100rpx;
|
height: 100rpx;
|
||||||
background-color: #dd0000;
|
background-color: #dd0000;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
border-radius: 50%;
|
border-radius: 20rpx;
|
||||||
|
font-size: 34rpx;
|
||||||
|
font-weight: 700;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
|
margin-top: 40rpx;
|
||||||
}
|
}
|
||||||
130
packages/master/masterIndex/index.js
Normal file
130
packages/master/masterIndex/index.js
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
let util = require('../../../utils/util')
|
||||||
|
let apiArr = require('../../../api/water_filter')
|
||||||
|
|
||||||
|
// packages/master/masterIndex/index.js
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
funcList: [
|
||||||
|
{
|
||||||
|
text: "新装工单",
|
||||||
|
img: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/partner/partner_icon3.png?1",
|
||||||
|
url: "../order/index?type=0",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "维修工单",
|
||||||
|
img: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/partner/partner_icon4.png?1",
|
||||||
|
url: "../order/index?type=1",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "拆除工单",
|
||||||
|
img: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/removeIcon.png",
|
||||||
|
url: "../order/index?type=3",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "滤芯更换工单",
|
||||||
|
img: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/partsIcon.png",
|
||||||
|
url: "../order/index?type=2",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "设备管理",
|
||||||
|
img: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/partner/partner_icon2.png?1",
|
||||||
|
url: "../../WaterPurifier/pages/device/deviceList/deviceList",
|
||||||
|
}
|
||||||
|
],
|
||||||
|
serverInfo: {}
|
||||||
|
},
|
||||||
|
|
||||||
|
callPhone() {
|
||||||
|
let that = this
|
||||||
|
wx.makePhoneCall({
|
||||||
|
phoneNumber: that.data.serverInfo.customer_phone,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
jump(e) {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: e.currentTarget.dataset.url,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getMasterInfo() {
|
||||||
|
let that = this
|
||||||
|
util.postUrl(apiArr.masterInfo, {
|
||||||
|
user_id: wx.getStorageSync('userId')
|
||||||
|
}, res => {
|
||||||
|
that.setData({
|
||||||
|
info_id: res.info_id
|
||||||
|
})
|
||||||
|
wx.setStorageSync('info_id', res.info_id)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
getServerInfo() {
|
||||||
|
let that = this
|
||||||
|
util.postUrl(apiArr.getServerInfo, '', res => {
|
||||||
|
res.qr_code = res.qr_code.startsWith('http') ? res.qr_code : util.img_url + res.qr_code
|
||||||
|
console.log(res.qr_code);
|
||||||
|
that.setData({
|
||||||
|
serverInfo: res
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
this.getMasterInfo()
|
||||||
|
this.getServerInfo()
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
5
packages/master/masterIndex/index.json
Normal file
5
packages/master/masterIndex/index.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {
|
||||||
|
"Footer":"/component/masterFooter/index"
|
||||||
|
}
|
||||||
|
}
|
||||||
31
packages/master/masterIndex/index.wxml
Normal file
31
packages/master/masterIndex/index.wxml
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<view class="orderMsg">
|
||||||
|
<view class="Tit">工单管理</view>
|
||||||
|
<view class="func">
|
||||||
|
<view class="funcItem" wx:for="{{funcList}}" bind:tap="jump" data-url="{{item.url}}">
|
||||||
|
<image src="{{item.img}}" mode="heightFix" />
|
||||||
|
<view>{{item.text}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="orderMsg">
|
||||||
|
<view class="Tit">平台客服</view>
|
||||||
|
<view class="orderMsgBox">
|
||||||
|
<view class="orderMsgBox_left">
|
||||||
|
<view class="orderMsgBox_left1">
|
||||||
|
<view>平台电话</view>
|
||||||
|
<view bind:tap="callPhone">{{serverInfo.customer_phone}} <van-icon name="phone-o" /></view>
|
||||||
|
</view>
|
||||||
|
<view class="orderMsgBox_left2">
|
||||||
|
<view>工作时间</view>
|
||||||
|
<view>{{serverInfo.business_hours}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="orderMsgBox_right">
|
||||||
|
<image show-menu-by-longpress src="{{serverInfo.qr_code}}" mode="widthFix"/>
|
||||||
|
<span>长按保存二维码</span>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<Footer />
|
||||||
86
packages/master/masterIndex/index.wxss
Normal file
86
packages/master/masterIndex/index.wxss
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
page {
|
||||||
|
background-color: #f0f2fd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.orderMsg {
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 10rpx;
|
||||||
|
width: 90%;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Tit {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #222222;
|
||||||
|
margin-left: 30rpx;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.func {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
margin-top: 46rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.funcItem {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #222222;
|
||||||
|
width: 25%;
|
||||||
|
margin-bottom: 50rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.funcItem image {
|
||||||
|
height: 54rpx;
|
||||||
|
margin-bottom: 15rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.orderMsgBox {
|
||||||
|
display: flex;
|
||||||
|
/* align-items: center; */
|
||||||
|
align-items: stretch;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.orderMsgBox_left {
|
||||||
|
width: 48%;
|
||||||
|
background-color: #edf6fd;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.orderMsgBox_right {
|
||||||
|
width: 48%;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
border: 1rpx solid #000;
|
||||||
|
overflow: hidden;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 10rpx 0;
|
||||||
|
}
|
||||||
|
.orderMsgBox_right span{
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.orderMsgBox_left1 {
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.orderMsgBox_left2 {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
@ -1,3 +1,4 @@
|
|||||||
{
|
{
|
||||||
"usingComponents": {}
|
"usingComponents": {},
|
||||||
|
"navigationBarTitleText": "个人信息"
|
||||||
}
|
}
|
||||||
@ -9,7 +9,7 @@ Page({
|
|||||||
n: (app.menu.top - app.system.statusBarHeight) * 2 + app.menu.height, // 导航栏高度
|
n: (app.menu.top - app.system.statusBarHeight) * 2 + app.menu.height, // 导航栏高度
|
||||||
t: app.menu.top, // 胶囊局顶部距离
|
t: app.menu.top, // 胶囊局顶部距离
|
||||||
h: app.menu.height, // 胶囊高度
|
h: app.menu.height, // 胶囊高度
|
||||||
|
currentType: "",
|
||||||
option1: [
|
option1: [
|
||||||
{ text: '新装工单', value: 0 },
|
{ text: '新装工单', value: 0 },
|
||||||
{ text: '维修工单', value: 1 },
|
{ text: '维修工单', value: 1 },
|
||||||
@ -17,7 +17,8 @@ Page({
|
|||||||
{ text: '移机工单', value: 4 },
|
{ text: '移机工单', value: 4 },
|
||||||
{ text: '滤芯更换工单', value: 2 },
|
{ text: '滤芯更换工单', value: 2 },
|
||||||
],
|
],
|
||||||
active:0,
|
active: 0,
|
||||||
|
searchText: "",
|
||||||
|
|
||||||
value1: 0,
|
value1: 0,
|
||||||
page_num: 1,
|
page_num: 1,
|
||||||
@ -27,33 +28,63 @@ Page({
|
|||||||
NewOrderList: [], //新装工单
|
NewOrderList: [], //新装工单
|
||||||
RepairOrderList: [],//维修工单
|
RepairOrderList: [],//维修工单
|
||||||
PartOrderList: [],//滤芯跟换工单
|
PartOrderList: [],//滤芯跟换工单
|
||||||
UninstallOrderList:[],//拆卸工单
|
UninstallOrderList: [],//拆卸工单
|
||||||
RemoveList:[],//移机工单
|
RemoveList: [],//移机工单
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
info_id: "",//师傅id
|
info_id: "",//师傅id
|
||||||
},
|
},
|
||||||
|
back(){
|
||||||
|
wx.reLaunch({
|
||||||
changeActive(e){
|
url: '/packages/master/masterIndex/index',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
search() {
|
||||||
let that = this
|
let that = this
|
||||||
that.setData({
|
that.setData({
|
||||||
active:e.currentTarget.dataset.item.value,
|
|
||||||
page_num: 1,
|
|
||||||
NewOrderList: [],
|
NewOrderList: [],
|
||||||
RepairOrderList: [],
|
RepairOrderList: [],
|
||||||
PartOrderList: [],
|
PartOrderList: [],
|
||||||
UninstallOrderList:[],
|
UninstallOrderList: [],
|
||||||
|
RemoveList: [],
|
||||||
|
page_num: 1,
|
||||||
|
flag: false
|
||||||
})
|
})
|
||||||
|
|
||||||
if (that.data.active == 0) {
|
if (that.data.active == 0) {
|
||||||
that.getNewOrderList()
|
that.getNewOrderList()
|
||||||
} else if (that.data.active == 1) {
|
} else if (that.data.active == 1) {
|
||||||
that.gerRepairOrderList()
|
that.gerRepairOrderList()
|
||||||
} else if(that.data.active == 2){
|
} else if (that.data.active == 3) {
|
||||||
that.getPartOrderList()
|
that.getPartOrderList()
|
||||||
}else if(that.data.active == 3){
|
} else if (that.data.active == 2) {
|
||||||
|
this.getUninstallOrder()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
ipt1(e) {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
searchText: e.detail.value
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeActive(e) {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
active: e.currentTarget.dataset.item.value,
|
||||||
|
page_num: 1,
|
||||||
|
NewOrderList: [],
|
||||||
|
RepairOrderList: [],
|
||||||
|
PartOrderList: [],
|
||||||
|
UninstallOrderList: [],
|
||||||
|
})
|
||||||
|
|
||||||
|
if (that.data.active == 1) {
|
||||||
|
that.getNewOrderList()
|
||||||
|
} else if (that.data.active == 2) {
|
||||||
|
that.gerRepairOrderList()
|
||||||
|
} else if (that.data.active == 4) {
|
||||||
|
that.getPartOrderList()
|
||||||
|
} else if (that.data.active == 3) {
|
||||||
this.getUninstallOrder()
|
this.getUninstallOrder()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,13 +125,39 @@ Page({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onLoad() {
|
onLoad(options) {
|
||||||
|
let currentType = ''
|
||||||
|
if (options.type == 0) {
|
||||||
|
currentType = '新装工单'
|
||||||
|
wx.setNavigationBarTitle({
|
||||||
|
title: '新装工单',
|
||||||
|
})
|
||||||
|
} else if (options.type == 1) {
|
||||||
|
currentType = '维修工单'
|
||||||
|
wx.setNavigationBarTitle({
|
||||||
|
title: '维修工单',
|
||||||
|
})
|
||||||
|
} else if (options.type == 3) {
|
||||||
|
currentType = '拆除工单'
|
||||||
|
wx.setNavigationBarTitle({
|
||||||
|
title: '拆除工单',
|
||||||
|
})
|
||||||
|
} else if (options.type == 2) {
|
||||||
|
currentType = '滤芯更换工单'
|
||||||
|
wx.setNavigationBarTitle({
|
||||||
|
title: '滤芯更换工单',
|
||||||
|
})
|
||||||
|
}
|
||||||
// 移除原有的wx.setNavigationBarRightButton相关代码
|
// 移除原有的wx.setNavigationBarRightButton相关代码
|
||||||
let that = this
|
let that = this
|
||||||
wx.showShareMenu({
|
wx.showShareMenu({
|
||||||
withShareTicket: true,
|
withShareTicket: true,
|
||||||
menus: ['shareAppMessage', 'shareTimeline']
|
menus: ['shareAppMessage', 'shareTimeline']
|
||||||
})
|
})
|
||||||
|
that.setData({
|
||||||
|
currentType,
|
||||||
|
active: options.type
|
||||||
|
})
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
let that = this
|
let that = this
|
||||||
@ -109,17 +166,17 @@ Page({
|
|||||||
NewOrderList: [],
|
NewOrderList: [],
|
||||||
RepairOrderList: [],
|
RepairOrderList: [],
|
||||||
PartOrderList: [],
|
PartOrderList: [],
|
||||||
UninstallOrderList:[],
|
UninstallOrderList: [],
|
||||||
page_num: 1
|
page_num: 1,
|
||||||
|
searchText: ""
|
||||||
})
|
})
|
||||||
|
|
||||||
that.getMasterInfo()
|
that.getMasterInfo()
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
// 跳转到个人中心
|
// 跳转到个人中心
|
||||||
navigateToProfile() {
|
navigateToProfile() {
|
||||||
console.log(123);
|
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: '/packages/master/PersonCen/index'
|
url: '/packages/master/PersonCen/index'
|
||||||
});
|
});
|
||||||
@ -130,13 +187,14 @@ Page({
|
|||||||
let that = this
|
let that = this
|
||||||
wx.showLoading({
|
wx.showLoading({
|
||||||
title: '加载中...',
|
title: '加载中...',
|
||||||
mask:true
|
mask: true
|
||||||
})
|
})
|
||||||
util.postUrl(apiArr.getNewOrder, {
|
util.postUrl(apiArr.getNewOrder, {
|
||||||
info_id: that.data.info_id,
|
info_id: that.data.info_id,
|
||||||
search: that.data.searchCon,
|
search: that.data.searchCon,
|
||||||
page_num: that.data.page_num,
|
page_num: that.data.page_num,
|
||||||
page_size: that.data.page_size
|
page_size: that.data.page_size,
|
||||||
|
search: that.data.searchText,
|
||||||
}, res => {
|
}, res => {
|
||||||
wx.hideLoading()
|
wx.hideLoading()
|
||||||
if (res.msg == '操作成功') {
|
if (res.msg == '操作成功') {
|
||||||
@ -164,13 +222,14 @@ Page({
|
|||||||
let that = this
|
let that = this
|
||||||
wx.showLoading({
|
wx.showLoading({
|
||||||
title: '加载中...',
|
title: '加载中...',
|
||||||
mask:true
|
mask: true
|
||||||
|
|
||||||
})
|
})
|
||||||
util.postUrl(apiArr.gerRepairOrder, {
|
util.postUrl(apiArr.gerRepairOrder, {
|
||||||
info_id: that.data.info_id,
|
info_id: that.data.info_id,
|
||||||
page_num: that.data.page_num,
|
page_num: that.data.page_num,
|
||||||
page_size: that.data.page_size
|
page_size: that.data.page_size,
|
||||||
|
search: that.data.searchText
|
||||||
}, res => {
|
}, res => {
|
||||||
wx.hideLoading()
|
wx.hideLoading()
|
||||||
if (res.msg == '操作成功') {
|
if (res.msg == '操作成功') {
|
||||||
@ -197,13 +256,14 @@ Page({
|
|||||||
let that = this
|
let that = this
|
||||||
wx.showLoading({
|
wx.showLoading({
|
||||||
title: '加载中...',
|
title: '加载中...',
|
||||||
mask:true
|
mask: true
|
||||||
|
|
||||||
})
|
})
|
||||||
util.postUrl(apiArr.getPartOrder, {
|
util.postUrl(apiArr.getPartOrder, {
|
||||||
info_id: that.data.info_id,
|
info_id: that.data.info_id,
|
||||||
page_num: that.data.page_num,
|
page_num: that.data.page_num,
|
||||||
page_size: that.data.page_size
|
page_size: that.data.page_size,
|
||||||
|
search: that.data.searchText
|
||||||
}, res => {
|
}, res => {
|
||||||
wx.hideLoading()
|
wx.hideLoading()
|
||||||
if (res.msg == '操作成功') {
|
if (res.msg == '操作成功') {
|
||||||
@ -230,13 +290,14 @@ Page({
|
|||||||
let that = this
|
let that = this
|
||||||
wx.showLoading({
|
wx.showLoading({
|
||||||
title: '加载中...',
|
title: '加载中...',
|
||||||
mask:true
|
mask: true
|
||||||
})
|
})
|
||||||
util.postUrl(apiArr.getUninstallOrder, {
|
util.postUrl(apiArr.getUninstallOrder, {
|
||||||
info_id: that.data.info_id,
|
info_id: that.data.info_id,
|
||||||
status: 0,
|
status: 0,
|
||||||
page_num: that.data.page_num,
|
page_num: that.data.page_num,
|
||||||
page_size: that.data.page_size
|
page_size: that.data.page_size,
|
||||||
|
search: that.data.searchText
|
||||||
}, res => {
|
}, res => {
|
||||||
wx.hideLoading()
|
wx.hideLoading()
|
||||||
if (res.msg == '操作成功') {
|
if (res.msg == '操作成功') {
|
||||||
@ -257,7 +318,7 @@ Page({
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
//师傅信息
|
//师傅信息
|
||||||
getMasterInfo() {
|
getMasterInfo() {
|
||||||
@ -281,21 +342,21 @@ Page({
|
|||||||
NewOrderList: [],
|
NewOrderList: [],
|
||||||
RepairOrderList: [],
|
RepairOrderList: [],
|
||||||
PartOrderList: [],
|
PartOrderList: [],
|
||||||
UninstallOrderList:[],
|
UninstallOrderList: [],
|
||||||
page_num: 1
|
page_num: 1
|
||||||
})
|
})
|
||||||
if (that.data.active == 0) {
|
if (that.data.active == 0) {
|
||||||
that.getNewOrderList()
|
that.getNewOrderList()
|
||||||
} else if (that.data.active == 1) {
|
} else if (that.data.active == 1) {
|
||||||
that.gerRepairOrderList()
|
that.gerRepairOrderList()
|
||||||
} else if(that.data.active == 2){
|
} else if (that.data.active == 2) {
|
||||||
that.getPartOrderList()
|
that.getPartOrderList()
|
||||||
}else if(that.data.active == 3){
|
} else if (that.data.active == 3) {
|
||||||
this.getUninstallOrder()
|
this.getUninstallOrder()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onShareAppMessage(){
|
onShareAppMessage() {
|
||||||
return {
|
return {
|
||||||
title: '人人爱净水', // 分享卡片标题(必填)
|
title: '人人爱净水', // 分享卡片标题(必填)
|
||||||
path: '/pages/water_filter/water_filter', // 用户点击后跳转的路径(可选,默认当前页)
|
path: '/pages/water_filter/water_filter', // 用户点击后跳转的路径(可选,默认当前页)
|
||||||
@ -310,4 +371,32 @@ Page({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onReachBottom() {
|
||||||
|
let that = this
|
||||||
|
if (that.data.flag) {
|
||||||
|
that.getMasterInfo()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onPullDownRefresh() {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
flag: false,
|
||||||
|
NewOrderList: [],
|
||||||
|
RepairOrderList: [],
|
||||||
|
PartOrderList: [],
|
||||||
|
UninstallOrderList: [],
|
||||||
|
page_num: 1,
|
||||||
|
searchText: ""
|
||||||
|
})
|
||||||
|
that.getMasterInfo()
|
||||||
|
wx.stopPullDownRefresh();
|
||||||
|
},
|
||||||
|
|
||||||
|
//新增维修工单
|
||||||
|
addWorkOrder(){
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/packages/master/addNewOrder/index',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -2,5 +2,7 @@
|
|||||||
"navigationStyle": "default",
|
"navigationStyle": "default",
|
||||||
"usingComponents": {
|
"usingComponents": {
|
||||||
"Footer":"/component/masterFooter/index"
|
"Footer":"/component/masterFooter/index"
|
||||||
}
|
},
|
||||||
|
"enablePullDownRefresh": true,
|
||||||
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
@ -1,28 +1,66 @@
|
|||||||
|
<view class="nav-box" style="padding-top: {{ t }}px;;">
|
||||||
|
<view class="nav-bar" style="height: {{ h }}px;">
|
||||||
|
<view class="nav-bar-left" bind:tap="back">
|
||||||
|
<van-icon name="arrow-left" size="24px" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="nav-bar-title" style="height: {{ h }}px;line-height: {{ h }}px;color: {{color}};font-size: 28rpx;">
|
||||||
|
{{currentType}}
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="nav-bar-right">
|
||||||
|
<image style="opacity: 0;" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/back.png" mode="widthFix" style="width:16rpx;height:28rpx" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 将van-dropdown-menu和search-bar包裹在一个view中 -->
|
<!-- 将van-dropdown-menu和search-bar包裹在一个view中 -->
|
||||||
<view class="fixed-top">
|
<view class="fixed-top">
|
||||||
|
|
||||||
<view class="navBox">
|
<!-- <view class="navBox">
|
||||||
<view class="{{active == item.value?'navItem active':'navItem'}}" data-item="{{item}}" bind:tap="changeActive" wx:for="{{option1}}">{{item.text}}</view>
|
<view class="{{active == item.value?'navItem active':'navItem'}}" data-item="{{item}}" bind:tap="changeActive" wx:for="{{option1}}">{{item.text}}</view>
|
||||||
|
</view> -->
|
||||||
|
<view class="navBox">
|
||||||
|
<view class="navItem active">{{currentType}}</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<view class="upkeep_select">
|
||||||
|
<view class="ipt">
|
||||||
|
<input value="{{searchText}}" confirm-type="search" bindconfirm="search" bindinput="ipt1" type="text" placeholder="设备编号/客户名称/客户手机/客户地址" placeholder-style="color: #999999;font-size: 28rpx;" />
|
||||||
|
|
||||||
|
<view class="searchBox" bind:tap="search">
|
||||||
|
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/dervice/deriveSearch.png?1" mode="widthFix" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<!-- 原有内容包裹在content中 -->
|
<!-- 原有内容包裹在content中 -->
|
||||||
<view class="content">
|
<view class="content">
|
||||||
|
|
||||||
<!-- 新装工单 -->
|
<!-- 新装工单 -->
|
||||||
<scroll-view class="order-list" scroll-y wx:if="{{active == 0}}">
|
<view class="order-list" scroll-y wx:if="{{active == 0 && NewOrderList.length != 0}}">
|
||||||
<block wx:for="{{NewOrderList}}">
|
<block wx:for="{{NewOrderList}}">
|
||||||
<view class="order-item" wx:key="install_id" data-id="{{item.install_id}}" bind:tap="viewOrderDetail">
|
<view class="order-item" wx:key="install_id" data-id="{{item.install_id}}" bind:tap="viewOrderDetail">
|
||||||
<!-- 订单基本信息 -->
|
<!-- 工单基本信息 -->
|
||||||
<view class="order-info">
|
<view class="order-info">
|
||||||
|
|
||||||
<view class="order-field">
|
<view class="order-field">
|
||||||
<text class="label">提交人:</text>
|
<text class="label">产品名称:</text>
|
||||||
|
<text class="value">{{item.product_name}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">设备编号:</text>
|
||||||
|
<text class="value">{{item.device_code}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">客户姓名:</text>
|
||||||
<text class="value">{{item.customer_name}}</text>
|
<text class="value">{{item.customer_name}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="order-field">
|
<view class="order-field">
|
||||||
<text class="label">联系电话:</text>
|
<text class="label">客户手机:</text>
|
||||||
<text class="value">{{item.customer_phone}}</text>
|
<text class="value">{{item.customer_phone}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="order-field">
|
<view class="order-field">
|
||||||
@ -31,7 +69,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="order-field">
|
<view class="order-field">
|
||||||
<text class="label">预约地址:</text>
|
<text class="label">详细地址:</text>
|
||||||
<text class="value">{{item.region}} {{item.address}}</text>
|
<text class="value">{{item.region}} {{item.address}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -41,37 +79,41 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="order-field">
|
<view class="order-field">
|
||||||
<text class="label">订单状态:</text>
|
<text class="label">工单状态:</text>
|
||||||
<text class="value " wx:if="{{item.status == '1'}}">待分配</text>
|
<text class="value " wx:if="{{item.status == '1'}}">待分配</text>
|
||||||
<text class="value " wx:if="{{item.status == '2'}}">安装中</text>
|
<text class="value " wx:if="{{item.status == '2'}}">安装中</text>
|
||||||
<text class="value " wx:if="{{item.status == '3'}}">待激活</text>
|
<text class="value " wx:if="{{item.status == '3'}}">待激活</text>
|
||||||
<text class="value " wx:if="{{item.status == '4'}}">已安装</text>
|
<text class="value " wx:if="{{item.status == '4'}}">已安装</text>
|
||||||
<text class="value " wx:if="{{item.status == '5'}}">忽略</text>
|
<text class="value " wx:if="{{item.status == '5'}}">已撤销</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
</scroll-view>
|
</view>
|
||||||
|
<van-empty description="暂无数据" wx:if="{{active == 0 && NewOrderList.length == 0}}" />
|
||||||
<!-- 维修工单 -->
|
<!-- 维修工单 -->
|
||||||
<scroll-view class="order-list" scroll-y wx:if="{{active == 1}}">
|
<view class="order-list" scroll-y wx:if="{{active == 1 && RepairOrderList.length != 0}}">
|
||||||
<block wx:for="{{RepairOrderList}}">
|
<block wx:for="{{RepairOrderList}}">
|
||||||
<view class="order-item" wx:key="install_id" data-id="{{item.repair_id}}" bind:tap="viewOrderDetail">
|
<view class="order-item" wx:key="install_id" data-id="{{item.repair_id}}" bind:tap="viewOrderDetail">
|
||||||
<!-- 订单基本信息 -->
|
<!-- 工单基本信息 -->
|
||||||
<view class="order-info">
|
<view class="order-info">
|
||||||
<view class="order-field">
|
<view class="order-field">
|
||||||
<text class="label">设备名称:</text>
|
<text class="label">设备名称:</text>
|
||||||
<text class="value">{{item.parts_name}}</text>
|
<text class="value">{{item.product_name}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">设备编号:</text>
|
||||||
|
<text class="value">{{item.device_code}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<view class="order-field">
|
<view class="order-field">
|
||||||
<text class="label">提交人:</text>
|
<text class="label">客户姓名:</text>
|
||||||
<text class="value">{{item.customer_name}}</text>
|
<text class="value">{{item.customer_name}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="order-field">
|
<view class="order-field">
|
||||||
<text class="label">联系电话:</text>
|
<text class="label">客户手机:</text>
|
||||||
<text class="value">{{item.customer_phone}}</text>
|
<text class="value">{{item.customer_phone}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="order-field">
|
<view class="order-field">
|
||||||
@ -80,7 +122,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="order-field">
|
<view class="order-field">
|
||||||
<text class="label">预约地址:</text>
|
<text class="label">详细地址:</text>
|
||||||
<text class="value">{{item.region}}{{item.address}}</text>
|
<text class="value">{{item.region}}{{item.address}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -100,34 +142,34 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
</scroll-view>
|
</view>
|
||||||
|
<van-empty description="暂无数据" wx:if="{{active == 1 && RepairOrderList.length == 0}}" />
|
||||||
<!-- 滤材更换工单 -->
|
<!-- 滤材更换工单 -->
|
||||||
<scroll-view class="order-list" scroll-y wx:if="{{active == 2}}">
|
<view class="order-list" scroll-y wx:if="{{active == 2 && PartOrderList.length != 0}}">
|
||||||
<block wx:for="{{PartOrderList}}">
|
<block wx:for="{{PartOrderList}}">
|
||||||
<view class="order-item" wx:key="install_id" data-id="{{item.replace_id}}" bind:tap="viewOrderDetail">
|
<view class="order-item" wx:key="install_id" data-id="{{item.replace_id}}" bind:tap="viewOrderDetail">
|
||||||
<!-- 订单基本信息 -->
|
<!-- 工单基本信息 -->
|
||||||
<view class="order-info">
|
<view class="order-info">
|
||||||
<!-- <view class="order-field">
|
<view class="order-field">
|
||||||
<text class="label">设备名称:</text>
|
<text class="label">设备名称:</text>
|
||||||
<text class="value">{{item.device.product_name}}</text>
|
<text class="value">{{item.device.product_name}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="order-field">
|
<view class="order-field">
|
||||||
<text class="label">配件名称:</text>
|
<text class="label">设备编号:</text>
|
||||||
<text class="value">{{item.parts_list[0].parts_name}}</text>
|
<text class="value">{{item.device_code}}</text>
|
||||||
</view> -->
|
</view>
|
||||||
|
|
||||||
<view class="order-field">
|
<view class="order-field">
|
||||||
<text class="label">提交人:</text>
|
<text class="label">客户姓名:</text>
|
||||||
<text class="value">{{item.customer_name}}</text>
|
<text class="value">{{item.customer_name}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="order-field">
|
<view class="order-field">
|
||||||
<text class="label">联系电话:</text>
|
<text class="label">客户手机:</text>
|
||||||
<text class="value">{{item.customer_phone}}</text>
|
<text class="value">{{item.customer_phone}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="order-field">
|
<view class="order-field">
|
||||||
<text class="label">预约地址:</text>
|
<text class="label">详细地址:</text>
|
||||||
<text class="value">{{item.region}} {{item.address}}</text>
|
<text class="value">{{item.region}} {{item.address}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -143,53 +185,57 @@
|
|||||||
|
|
||||||
|
|
||||||
<view class="order-field">
|
<view class="order-field">
|
||||||
<text class="label">订单状态:</text>
|
<text class="label">工单状态:</text>
|
||||||
<text class="value " wx:if="{{item.status == '1'}}">待分配</text>
|
<text class="value " wx:if="{{item.status == '1'}}">待分配</text>
|
||||||
<text class="value " wx:if="{{item.status == '2'}}">待更换</text>
|
<text class="value " wx:if="{{item.status == '2'}}">待更换</text>
|
||||||
<text class="value " wx:if="{{item.status == '3'}}">已更换</text>
|
<text class="value " wx:if="{{item.status == '3'}}">已更换</text>
|
||||||
<text class="value " wx:if="{{item.status == '4'}}">已撤销</text>
|
<text class="value " wx:if="{{item.status == '4'}}">已忽略</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
</scroll-view>
|
</view>
|
||||||
|
<van-empty description="暂无数据" wx:if="{{active == 2 && PartOrderList.length == 0}}" />
|
||||||
|
<!-- 拆机工单 -->
|
||||||
<scroll-view class="order-list" scroll-y wx:if="{{active == 3}}">
|
<view class="order-list" scroll-y wx:if="{{active == 3 && UninstallOrderList.length != 0}}">
|
||||||
<block wx:for="{{UninstallOrderList}}">
|
<block wx:for="{{UninstallOrderList}}">
|
||||||
<view class="order-item" wx:key="uninstall_id" data-id="{{item.uninstall_id}}" bind:tap="viewOrderDetail">
|
<view class="order-item" wx:key="uninstall_id" data-id="{{item.uninstall_id}}" bind:tap="viewOrderDetail">
|
||||||
<!-- 订单基本信息 -->
|
<!-- 工单基本信息 -->
|
||||||
<view class="order-info">
|
<view class="order-info">
|
||||||
<view class="order-field">
|
<view class="order-field">
|
||||||
<text class="label">设备名称:</text>
|
<text class="label">产品名称:</text>
|
||||||
<text class="value">{{item.device.product_name}}</text>
|
<text class="value">{{item.product_name}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">设备编号:</text>
|
||||||
|
<text class="value">{{item.device_code}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="order-field">
|
<view class="order-field">
|
||||||
<text class="label">指派人:</text>
|
<text class="label">师傅姓名:</text>
|
||||||
<text class="value">{{item.repairman_name}}</text>
|
<text class="value">{{item.repairman_name}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="order-field">
|
<view class="order-field">
|
||||||
<text class="label" style="white-space: normal;">指派人电话:</text>
|
<text class="label" style="white-space: normal;">师傅电话:</text>
|
||||||
<text class="value">{{item.repairman_phone}}</text>
|
<text class="value">{{item.repairman_phone}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="order-field">
|
<view class="order-field">
|
||||||
<text class="label">提交人:</text>
|
<text class="label">客户姓名:</text>
|
||||||
<text class="value">{{item.customer_name}}</text>
|
<text class="value">{{item.customer_name}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="order-field">
|
<view class="order-field">
|
||||||
<text class="label">联系电话:</text>
|
<text class="label">客户手机:</text>
|
||||||
<text class="value">{{item.customer_phone}}</text>
|
<text class="value">{{item.customer_phone}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- <view class="order-field">
|
<view class="order-field">
|
||||||
<text class="label">预约地址:</text>
|
<text class="label">详细地址:</text>
|
||||||
<text class="value">{{item.region}} {{item.address}}</text>
|
<text class="value">{{item.region}} {{item.address}}</text>
|
||||||
</view> -->
|
</view>
|
||||||
|
|
||||||
<view class="order-field">
|
<view class="order-field">
|
||||||
<text class="label">预约时间:</text>
|
<text class="label">预约时间:</text>
|
||||||
@ -208,9 +254,12 @@
|
|||||||
|
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
</scroll-view>
|
</view>
|
||||||
|
<van-empty description="暂无数据" wx:if="{{active == 3 && UninstallOrderList.length == 0}}" />
|
||||||
|
|
||||||
|
<!-- 移机工单 -->
|
||||||
|
<van-empty description="暂无数据" wx:if="{{active == 4}}" />
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <view class="addBtn" bind:tap="addWorkOrder" wx:if="{{active == 1}}">新增</view> -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<Footer />
|
|
||||||
@ -1,6 +1,15 @@
|
|||||||
.container {
|
.container {
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
}
|
}
|
||||||
|
.nav-box{
|
||||||
|
padding-bottom: 10rpx;
|
||||||
|
}
|
||||||
|
.nav-bar-right{
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
page {
|
||||||
|
padding-bottom: 120rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.search-bar {
|
.search-bar {
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -23,7 +32,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.order-list {
|
.order-list {
|
||||||
height: calc(100vh - 160rpx);
|
/* height: calc(100vh - 160rpx); */
|
||||||
}
|
}
|
||||||
|
|
||||||
.order-item {
|
.order-item {
|
||||||
@ -120,18 +129,12 @@
|
|||||||
|
|
||||||
/* 新增固定定位样式 */
|
/* 新增固定定位样式 */
|
||||||
.fixed-top {
|
.fixed-top {
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
z-index: 999;
|
|
||||||
background: #fff;
|
background: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 调整内容区域的上边距 */
|
/* 调整内容区域的上边距 */
|
||||||
.content {
|
.content {
|
||||||
margin-top: 80rpx;
|
|
||||||
/* 根据实际高度调整 */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.search_icon {
|
.search_icon {
|
||||||
@ -147,7 +150,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.navItem {
|
.navItem {
|
||||||
flex: 1;
|
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
@ -158,6 +160,7 @@
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
position: relative;
|
position: relative;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.active::after {
|
.active::after {
|
||||||
@ -183,11 +186,12 @@
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
flex: unset;
|
flex: unset;
|
||||||
}
|
}
|
||||||
.order-field2{
|
|
||||||
|
.order-field2 {
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn2{
|
.btn2 {
|
||||||
width: 120rpx;
|
width: 120rpx;
|
||||||
height: 50rpx;
|
height: 50rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -198,7 +202,8 @@
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
flex: unset;
|
flex: unset;
|
||||||
}
|
}
|
||||||
.btn3{
|
|
||||||
|
.btn3 {
|
||||||
width: 120rpx;
|
width: 120rpx;
|
||||||
height: 50rpx;
|
height: 50rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -209,3 +214,80 @@
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
flex: unset;
|
flex: unset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.upkeep_select {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #222222;
|
||||||
|
background-color: #F9F9F9;
|
||||||
|
padding: 16rpx 20rpx;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
padding-bottom: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.upkeep_select .ipt {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
background-color: #fff;
|
||||||
|
width: 710rpx;
|
||||||
|
height: 98rpx;
|
||||||
|
background: #FFFFFF;
|
||||||
|
border-radius: 100rpx 100rpx 100rpx 100rpx;
|
||||||
|
padding-left: 26rpx;
|
||||||
|
padding-right: 26rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ipt input{
|
||||||
|
flex: 1;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.ipt image {
|
||||||
|
width: 42rpx;
|
||||||
|
height: 42rpx;
|
||||||
|
}
|
||||||
|
.searchBox{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding-left: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.addBtn {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
width: 100rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
background: #2583FF;
|
||||||
|
position: fixed;
|
||||||
|
right: 55rpx;
|
||||||
|
bottom: 200rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.addBtn::after {
|
||||||
|
content: '';
|
||||||
|
background: rgba(77, 154, 255,.5);
|
||||||
|
filter: blur(10.899999618530273rpx);
|
||||||
|
width: 90rpx;
|
||||||
|
height: 90rpx;
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
top: 50%;
|
||||||
|
transform: translate(-50%,-50%);
|
||||||
|
border-radius: 50%;
|
||||||
|
overflow: hidden;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
|||||||
@ -25,7 +25,9 @@ Page({
|
|||||||
dis1: false,
|
dis1: false,
|
||||||
dis2: false,
|
dis2: false,
|
||||||
dis3: false,
|
dis3: false,
|
||||||
deviceInfo: {},
|
deviceInfo: {
|
||||||
|
device_code:""
|
||||||
|
},
|
||||||
deviceCode: "",
|
deviceCode: "",
|
||||||
|
|
||||||
|
|
||||||
@ -130,7 +132,7 @@ Page({
|
|||||||
newOrderDesc: res,
|
newOrderDesc: res,
|
||||||
imgList: newArr,
|
imgList: newArr,
|
||||||
msg:res.install_desc,
|
msg:res.install_desc,
|
||||||
newOrderDateAppointment:res.remaining_days
|
newOrderDateAppointment:res.remaining_days?res.remaining_days:''
|
||||||
})
|
})
|
||||||
|
|
||||||
if (res.status == 5 ) {
|
if (res.status == 5 ) {
|
||||||
@ -207,7 +209,7 @@ Page({
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!that.data.deviceInfo.device_id) {
|
if (!that.data.deviceInfo.device_code) {
|
||||||
return wx.showToast({
|
return wx.showToast({
|
||||||
title: '请扫码设备二维码',
|
title: '请扫码设备二维码',
|
||||||
icon: "none"
|
icon: "none"
|
||||||
@ -221,6 +223,21 @@ Page({
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
util.postUrl(apiArr.getDeviceByCode, {
|
||||||
|
device_code: that.data.deviceInfo.device_code,
|
||||||
|
install_id:that.data.id
|
||||||
|
}, res => {
|
||||||
|
console.log(res,'res');
|
||||||
|
if(res.msg == '设备与订单产品不匹配'){
|
||||||
|
|
||||||
|
return wx.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon:"none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
that.setData({
|
||||||
|
deviceInfo: res
|
||||||
|
})
|
||||||
wx.showModal({
|
wx.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: content,
|
content: content,
|
||||||
@ -242,9 +259,10 @@ Page({
|
|||||||
icon: "none"
|
icon: "none"
|
||||||
})
|
})
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
wx.navigateBack({
|
// wx.navigateBack({
|
||||||
delta: 1
|
// delta: 1
|
||||||
})
|
// })
|
||||||
|
that.getNewOrderDesc()
|
||||||
}, 1500)
|
}, 1500)
|
||||||
} else {
|
} else {
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
@ -256,6 +274,8 @@ Page({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
cancelNewOrder() {
|
cancelNewOrder() {
|
||||||
let that = this
|
let that = this
|
||||||
@ -280,14 +300,14 @@ Page({
|
|||||||
success: (res) => {
|
success: (res) => {
|
||||||
// 处理扫码结果
|
// 处理扫码结果
|
||||||
this.setData({
|
this.setData({
|
||||||
deviceCode: res.result
|
deviceCode: res.result,
|
||||||
|
"deviceInfo.device_code":res.result
|
||||||
});
|
});
|
||||||
|
|
||||||
util.postUrl(apiArr.getDeviceByCode, {
|
util.postUrl(apiArr.getDeviceByCode, {
|
||||||
device_code: res.result,
|
device_code: res.result,
|
||||||
install_id:that.data.id
|
install_id:that.data.id
|
||||||
}, res => {
|
}, res => {
|
||||||
console.log(res, '222');
|
|
||||||
that.setData({
|
that.setData({
|
||||||
deviceInfo: res
|
deviceInfo: res
|
||||||
})
|
})
|
||||||
@ -302,6 +322,24 @@ Page({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
iptDeviceCode(e){
|
||||||
|
let that = this
|
||||||
|
console.log(e);
|
||||||
|
that.setData({
|
||||||
|
"deviceInfo.device_code":e.detail.value
|
||||||
|
})
|
||||||
|
},
|
||||||
|
iptSearch(){
|
||||||
|
let that = this
|
||||||
|
util.postUrl(apiArr.getDeviceByCode, {
|
||||||
|
device_code: that.data.deviceInfo.device_code,
|
||||||
|
install_id:that.data.id
|
||||||
|
}, res => {
|
||||||
|
that.setData({
|
||||||
|
deviceInfo: res
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
// 新装///////////////////////////////
|
// 新装///////////////////////////////
|
||||||
|
|
||||||
// 维修 ///////////////////////////////
|
// 维修 ///////////////////////////////
|
||||||
@ -362,6 +400,7 @@ Page({
|
|||||||
})
|
})
|
||||||
if (res.msg == '操作成功') {
|
if (res.msg == '操作成功') {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|
||||||
wx.navigateBack({
|
wx.navigateBack({
|
||||||
delta: 1
|
delta: 1
|
||||||
})
|
})
|
||||||
@ -398,6 +437,7 @@ Page({
|
|||||||
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
completePartOrder(e) {
|
completePartOrder(e) {
|
||||||
let status = Number(e.currentTarget.dataset.type)
|
let status = Number(e.currentTarget.dataset.type)
|
||||||
let that = this
|
let that = this
|
||||||
@ -423,9 +463,19 @@ Page({
|
|||||||
})
|
})
|
||||||
if (res.msg == '操作成功') {
|
if (res.msg == '操作成功') {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
wx.navigateBack({
|
// wx.navigateBack({
|
||||||
delta: 1
|
// delta: 1
|
||||||
|
// })
|
||||||
|
// device_id
|
||||||
|
if(status == 3){
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/packages/master/deviceInfo/index?id=' + that.data.partOrderDesc.device_id,
|
||||||
})
|
})
|
||||||
|
}else{
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/packages/master/order/index?type=2',
|
||||||
|
})
|
||||||
|
}
|
||||||
}, 1500);
|
}, 1500);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -559,9 +609,16 @@ Page({
|
|||||||
icon: "none"
|
icon: "none"
|
||||||
})
|
})
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
wx.navigateBack({
|
// wx.navigateBack({
|
||||||
delta: 1
|
// delta: 1
|
||||||
|
// })
|
||||||
|
that.setData({
|
||||||
|
uninstallMsg:"",
|
||||||
|
imgList2:[],
|
||||||
|
imgList:[],
|
||||||
|
uninstall_time:"",
|
||||||
})
|
})
|
||||||
|
that.getUninstallDesc()
|
||||||
}, 1500)
|
}, 1500)
|
||||||
} else {
|
} else {
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
@ -638,10 +695,10 @@ Page({
|
|||||||
that.getNewOrderDesc()
|
that.getNewOrderDesc()
|
||||||
} else if (options.type == 1) {
|
} else if (options.type == 1) {
|
||||||
that.getRepairOrderDesc()
|
that.getRepairOrderDesc()
|
||||||
} else if (options.type == 2) {
|
|
||||||
that.getPartOrderDesc()
|
|
||||||
} else if (options.type == 3) {
|
} else if (options.type == 3) {
|
||||||
that.getUninstallDesc()
|
that.getUninstallDesc()
|
||||||
|
} else if (options.type == 2) {
|
||||||
|
that.getPartOrderDesc()
|
||||||
}
|
}
|
||||||
|
|
||||||
wx.showShareMenu({
|
wx.showShareMenu({
|
||||||
|
|||||||
@ -3,10 +3,30 @@
|
|||||||
<block wx:if="{{type == 0}}">
|
<block wx:if="{{type == 0}}">
|
||||||
<!-- 产品信息 -->
|
<!-- 产品信息 -->
|
||||||
<view class="section">
|
<view class="section">
|
||||||
<view class="section-title">工单信息</view>
|
<view class="section-title section-title2">
|
||||||
|
工单信息
|
||||||
|
<view class="section-title2_status">
|
||||||
|
<text class="value " wx:if="{{newOrderDesc.status == '1'}}">待分配</text>
|
||||||
|
<text class="value " wx:if="{{newOrderDesc.status == '2'}}">安装中</text>
|
||||||
|
<text class="value " wx:if="{{newOrderDesc.status == '3'}}">待激活</text>
|
||||||
|
<text class="value " wx:if="{{newOrderDesc.status == '4'}}">已安装</text>
|
||||||
|
<text class="value " wx:if="{{newOrderDesc.status == '5'}}">忽略</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
<text class="label">产品名称:</text>
|
<text class="label">订单编号:</text>
|
||||||
<text class="value">{{newOrderDesc.product_name || '暂无数据'}}</text>
|
<text class="value">{{newOrderDesc.install_no || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">设备编号:</text>
|
||||||
|
<!-- wx:if="{{newOrderDesc.status == 2}}" -->
|
||||||
|
<view class="value value2" wx:if="{{newOrderDesc.status == 2}}">
|
||||||
|
<input type="text" confirm-type="search" bindconfirm="iptSearch" bind:input="iptDeviceCode" value="{{deviceInfo.device_code}}" placeholder="请输入设备编码" />
|
||||||
|
<image bind:tap="scanQrcode" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/scanIcon.png" mode="aspectFill"/>
|
||||||
|
</view>
|
||||||
|
<text class="value" wx:else>{{newOrderDesc.device_code || '暂无数据'}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
@ -26,22 +46,14 @@
|
|||||||
|
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
<text class="label">客户地址:</text>
|
<text class="label">客户地址:</text>
|
||||||
<text class="value">{{newOrderDesc.address || '暂无数据'}}</text>
|
<text class="value">{{newOrderDesc.region + newOrderDesc.address || '暂无数据'}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- <view class="info-item">
|
|
||||||
<text class="label">到期日期:</text>
|
|
||||||
<text class="value">{{newOrderDesc.expiration_duration || '暂无数据'}}</text>
|
|
||||||
</view> -->
|
|
||||||
|
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
<text class="label">订单状态:</text>
|
<text class="label">创建时间:</text>
|
||||||
<text class="value " wx:if="{{newOrderDesc.status == '1'}}">待分配</text>
|
<text class="value">{{newOrderDesc.create_time || '暂无数据'}}</text>
|
||||||
<text class="value " wx:if="{{newOrderDesc.status == '2'}}">安装中</text>
|
|
||||||
<text class="value " wx:if="{{newOrderDesc.status == '3'}}">待激活</text>
|
|
||||||
<text class="value " wx:if="{{newOrderDesc.status == '4'}}">已安装</text>
|
|
||||||
<text class="value " wx:if="{{newOrderDesc.status == '5'}}">忽略</text>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<view class="info-item" wx:if="{{newOrderDesc.product_icon}}">
|
<view class="info-item" wx:if="{{newOrderDesc.product_icon}}">
|
||||||
<text class="label">产品图片:</text>
|
<text class="label">产品图片:</text>
|
||||||
</view>
|
</view>
|
||||||
@ -49,40 +61,13 @@
|
|||||||
<image src="{{newOrderDesc.product_icon2}}" mode="aspectFit" />
|
<image src="{{newOrderDesc.product_icon2}}" mode="aspectFit" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</view>
|
|
||||||
<view class="section">
|
|
||||||
<view class="section-title">安装说明</view>
|
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
<text class="label">说明:</text>
|
<text class="label">产品名称:</text>
|
||||||
<input class="value" value="{{msg}}" disabled="{{dis1}}" wx:if="{{newOrderDesc.status != 5}}" bindinput="updateInstructions" placeholder="请输入安装说明" />
|
<text class="value">{{newOrderDesc.product_name || '暂无数据'}}</text>
|
||||||
<input class="value" value="{{msg}}" disabled="{{true}}" wx:if="{{newOrderDesc.status == 5}}" bindinput="updateInstructions" placeholder="请输入安装说明" />
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="info-item" wx:if="{{dis1}}">
|
|
||||||
<text class="label">安装时间:</text>
|
|
||||||
<input class="value" value="{{newOrderDesc.install_time}}" disabled />
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="info-item item2">
|
|
||||||
<text class="label">设备编码:{{newOrderDesc.device_code}}</text>
|
|
||||||
<view class="value value2" wx:if="{{!deviceCode}}">
|
|
||||||
<view class="btn" bind:tap="scanQrcode" wx:if="{{newOrderDesc.status == '2'}}">去扫码</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="value value3" wx:if="{{deviceCode}}">
|
|
||||||
{{deviceInfo.device_code}}
|
|
||||||
<view class="btn" bind:tap="scanQrcode">重新扫码</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="info-item" wx:if="{{newOrderDesc.status == 3}}">
|
|
||||||
<text class="label">剩余天数:</text>
|
|
||||||
<input class="value" type="number" bindinput="changeNewAppointment" placeholder="请输入剩余天数" value="{{newOrderDateAppointment}}" />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 安装图片 -->
|
<!-- 安装图片 -->
|
||||||
<view class="section">
|
<view class="section">
|
||||||
<view class="section-title">安装图片</view>
|
<view class="section-title">安装图片</view>
|
||||||
@ -99,18 +84,73 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<view class="section">
|
||||||
|
<view class="section-title">安装说明</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">说明:</text>
|
||||||
|
<input class="value" value="{{msg}}" disabled="{{dis1}}" wx:if="{{newOrderDesc.status != 5}}" bindinput="updateInstructions" placeholder="请输入安装说明" />
|
||||||
|
<input class="value" value="{{msg}}" disabled="{{true}}" wx:if="{{newOrderDesc.status == 5}}" bindinput="updateInstructions" placeholder="请输入安装说明" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item" wx:if="{{dis1}}">
|
||||||
|
<text class="label">安装时间:</text>
|
||||||
|
<input class="value" value="{{newOrderDesc.install_time}}" disabled />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- <view class="info-item item4">
|
||||||
|
<text class="label">设备编码:{{newOrderDesc.device_code}}</text>
|
||||||
|
|
||||||
|
<view class="value value2" wx:if="{{!deviceCode}}">
|
||||||
|
<input type="text" wx:if="{{newOrderDesc.status == 2}}" value="{{deviceInfo.device_code}}" bindinput="iptDeviceCode" placeholder="请输入设备编码" />
|
||||||
|
<view class="btn" bind:tap="scanQrcode" wx:if="{{newOrderDesc.status == '2'}}">去扫码</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="value value2" wx:if="{{deviceCode}}">
|
||||||
|
<input type="text" wx:if="{{newOrderDesc.status == 2}}" value="{{deviceInfo.device_code}}" placeholder="请输入设备编码" />
|
||||||
|
<view class="btn" bind:tap="scanQrcode">重新扫码</view>
|
||||||
|
</view>
|
||||||
|
</view> -->
|
||||||
|
|
||||||
|
<view class="info-item" wx:if="{{newOrderDesc.status == 3}}">
|
||||||
|
<text class="label">剩余天数:</text>
|
||||||
|
<input class="value" type="number" bindinput="changeNewAppointment" placeholder="请输入剩余天数" value="{{newOrderDateAppointment}}" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
</block>
|
</block>
|
||||||
|
|
||||||
<!-- 维修工单 -->
|
<!-- 维修工单 -->
|
||||||
<block wx:if="{{type == 1}}">
|
<block wx:if="{{type == 1}}">
|
||||||
<!-- 产品信息 -->
|
<!-- 产品信息 -->
|
||||||
<view class="section">
|
<view class="section">
|
||||||
<view class="section-title">工单信息</view>
|
<view class="section-title section-title2">
|
||||||
|
工单信息
|
||||||
|
<view class="section-title2_status">
|
||||||
|
<text class="value " wx:if="{{repairOrderDesc.status == '1'}}">待指派</text>
|
||||||
|
<text class="value " wx:if="{{repairOrderDesc.status == '2'}}">待维修</text>
|
||||||
|
<text class="value " wx:if="{{repairOrderDesc.status == '3'}}">维修完成</text>
|
||||||
|
<text class="value " wx:if="{{repairOrderDesc.status == '4'}}">已取消</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">订单编号:</text>
|
||||||
|
<text class="value">{{repairOrderDesc.repair_no || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
<text class="label">产品名称:</text>
|
<text class="label">产品名称:</text>
|
||||||
<text class="value">{{repairOrderDesc.product_name || '暂无数据'}}</text>
|
<text class="value">{{repairOrderDesc.product_name || '暂无数据'}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">设备编号:</text>
|
||||||
|
<text class="value">{{repairOrderDesc.device_code || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
<text class="label">约定时间:</text>
|
<text class="label">约定时间:</text>
|
||||||
<text class="value">{{repairOrderDesc.appointment_time || '暂无数据'}}</text>
|
<text class="value">{{repairOrderDesc.appointment_time || '暂无数据'}}</text>
|
||||||
@ -128,7 +168,7 @@
|
|||||||
|
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
<text class="label">客户地址:</text>
|
<text class="label">客户地址:</text>
|
||||||
<text class="value">{{repairOrderDesc.address || '暂无数据'}}</text>
|
<text class="value">{{repairOrderDesc.region + repairOrderDesc.address || '暂无数据'}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
@ -136,13 +176,7 @@
|
|||||||
<text class="value">{{repairOrderDesc.fault_desc || '暂无数据'}}</text>
|
<text class="value">{{repairOrderDesc.fault_desc || '暂无数据'}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="info-item">
|
|
||||||
<text class="label">订单状态:</text>
|
|
||||||
<text class="value " wx:if="{{repairOrderDesc.status == '1'}}">待指派</text>
|
|
||||||
<text class="value " wx:if="{{repairOrderDesc.status == '2'}}">待维修</text>
|
|
||||||
<text class="value " wx:if="{{repairOrderDesc.status == '3'}}">维修完成</text>
|
|
||||||
<text class="value " wx:if="{{repairOrderDesc.status == '4'}}">已取消</text>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
<text class="label">工单来源:</text>
|
<text class="label">工单来源:</text>
|
||||||
@ -151,6 +185,11 @@
|
|||||||
<text class="value" wx:if="{{repairOrderDesc.order_source == 3}}">后台</text>
|
<text class="value" wx:if="{{repairOrderDesc.order_source == 3}}">后台</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">创建时间:</text>
|
||||||
|
<text class="value">{{repairOrderDesc.create_time || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
<text class="label">故障图片:</text>
|
<text class="label">故障图片:</text>
|
||||||
</view>
|
</view>
|
||||||
@ -192,13 +231,33 @@
|
|||||||
<block wx:if="{{type == 2}}">
|
<block wx:if="{{type == 2}}">
|
||||||
<!-- 产品信息 -->
|
<!-- 产品信息 -->
|
||||||
<view class="section">
|
<view class="section">
|
||||||
<view class="section-title">工单信息</view>
|
<view class="section-title section-title2">
|
||||||
|
工单信息
|
||||||
|
<view class="section-title2_status">
|
||||||
|
<text class="value" wx:if="{{partOrderDesc.status == '1'}}">待分配</text>
|
||||||
|
<text class="value" wx:if="{{partOrderDesc.status == '2'}}">待更换</text>
|
||||||
|
<text class="value" wx:if="{{partOrderDesc.status == '3'}}">已更换</text>
|
||||||
|
<text class="value" wx:if="{{partOrderDesc.status == '4'}}">已撤销</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">订单编号:</text>
|
||||||
|
<text class="value">{{partOrderDesc.replace_no || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
<text class="label">配件名称:</text>
|
<text class="label">配件名称:</text>
|
||||||
<text class="value">
|
<text class="value">
|
||||||
<text wx:for="{{partOrderDesc.parts_list}}" wx:key="index">{{item.parts_name}}</text>
|
<text wx:for="{{partOrderDesc.parts_list}}" wx:key="index">{{item.parts_name}}</text>
|
||||||
</text>
|
</text>
|
||||||
<!-- <text class="value">{{partOrderDesc.parts_name || '暂无数据'}}</text> -->
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">设备编号:</text>
|
||||||
|
<text class="value">{{partOrderDesc.device_code || '暂无数据'}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
@ -213,12 +272,22 @@
|
|||||||
|
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
<text class="label">客户电话:</text>
|
<text class="label">客户电话:</text>
|
||||||
<text class="value">{{partOrderDesc.customer_phone || '暂无数据'}}</text>
|
<text class="value">{{partOrderDesc.replace_man_name || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">师傅姓名:</text>
|
||||||
|
<text class="value">{{partOrderDesc.replace_man_phone || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">师傅电话:</text>
|
||||||
|
<text class="value">{{partOrderDesc.customer_phone }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
<text class="label">客户地址:</text>
|
<text class="label">客户地址:</text>
|
||||||
<text class="value">{{partOrderDesc.region}} {{partOrderDesc.address}}</text>
|
<text class="value">{{partOrderDesc.region + partOrderDesc.address || '暂无数据'}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
@ -239,12 +308,11 @@
|
|||||||
<text class="value">{{partOrderDesc.threshold_volume}}升</text>
|
<text class="value">{{partOrderDesc.threshold_volume}}升</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
<text class="label">订单状态:</text>
|
<text class="label">创建时间:</text>
|
||||||
<text class="value " wx:if="{{partOrderDesc.status == '1'}}">待分配</text>
|
<text class="value">{{partOrderDesc.create_time || '暂无数据'}}</text>
|
||||||
<text class="value " wx:if="{{partOrderDesc.status == '2'}}">待更换</text>
|
|
||||||
<text class="value " wx:if="{{partOrderDesc.status == '3'}}">已更换</text>
|
|
||||||
<text class="value " wx:if="{{partOrderDesc.status == '4'}}">已撤销</text>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
@ -268,38 +336,68 @@
|
|||||||
<input class="value" disabled="{{dis3}}" value="{{msg2}}" bindinput="updateInstructions2" placeholder="请输入更换说明" />
|
<input class="value" disabled="{{dis3}}" value="{{msg2}}" bindinput="updateInstructions2" placeholder="请输入更换说明" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<view class="section" wx:if="{{type == 2}}">
|
||||||
|
<view class="section-title">更换耗材</view>
|
||||||
|
<view wx:for="{{partOrderDesc.parts_list}}">
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">耗材名称:</text>
|
||||||
|
<text class="value">{{item.parts_name || '暂无数据'}}</text>
|
||||||
|
<text class="value" wx:if="{{partOrderDesc.billing_method == 1}}">剩余天数:{{item.available_days}}</text>
|
||||||
|
<text class="value" wx:if="{{partOrderDesc.billing_method == 2}}">剩余流量:{{item.available_volume}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</block>
|
</block>
|
||||||
|
|
||||||
|
<!-- 拆机工单 -->
|
||||||
<block wx:if="{{type == 3}}">
|
<block wx:if="{{type == 3}}">
|
||||||
<!-- 产品信息 -->
|
<!-- 产品信息 -->
|
||||||
<view class="section">
|
<view class="section">
|
||||||
<view class="section-title">工单信息</view>
|
<view class="section-title section-title2">
|
||||||
|
工单信息
|
||||||
|
|
||||||
|
<view class="section-title2_status">
|
||||||
|
<!-- 工单状态 -->
|
||||||
|
<!-- -->
|
||||||
|
<text class="value " wx:if="{{uninstallDesc.status == '2'}}">待拆机</text>
|
||||||
|
<text class="value " wx:if="{{uninstallDesc.status == '3'}}">待操作</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
<text class="label">设备名称:</text>
|
<text class="label">订单编号:</text>
|
||||||
|
<text class="value">{{uninstallDesc.uninstall_no || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">产品名称:</text>
|
||||||
<text class="value">{{uninstallDesc.device.product_name || '暂无数据'}}</text>
|
<text class="value">{{uninstallDesc.device.product_name || '暂无数据'}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
<text class="label">指派人:</text>
|
<text class="label">设备编号:</text>
|
||||||
<text class="value">{{uninstallDesc.repairman_name || '暂无数据'}}</text>
|
<text class="value">{{uninstallDesc.device_code || '暂无数据'}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="info-item">
|
|
||||||
<text class="label">联系电话:</text>
|
|
||||||
<text class="value">{{uninstallDesc.repairman_phone || '暂无数据'}}</text>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
<text class="label">提交人:</text>
|
<text class="label">客户姓名:</text>
|
||||||
<text class="value">{{uninstallDesc.customer_name}}</text>
|
<text class="value">{{uninstallDesc.customer_name}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
<text class="label">联系电话:</text>
|
<text class="label">客户手机:</text>
|
||||||
<text class="value">{{uninstallDesc.customer_phone}}</text>
|
<text class="value">{{uninstallDesc.customer_phone}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">详细地址:</text>
|
||||||
|
<text class="value">{{uninstallDesc.region + uninstallDesc.address || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
<text class="label">预约时间:</text>
|
<text class="label">预约时间:</text>
|
||||||
@ -307,10 +405,21 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
<text class="label">订单状态:</text>
|
<text class="label">师傅姓名:</text>
|
||||||
<text class="value " wx:if="{{uninstallDesc.status == '2'}}">待拆机</text>
|
<text class="value">{{uninstallDesc.master.name || '暂无数据'}}</text>
|
||||||
<text class="value " wx:if="{{uninstallDesc.status == '3'}}">待操作</text>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">师傅手机:</text>
|
||||||
|
<text class="value">{{uninstallDesc.master.phone || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">创建时间:</text>
|
||||||
|
<text class="value">{{uninstallDesc.create_time || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="section" wx:if="{{type == 1}}">
|
<view class="section" wx:if="{{type == 1}}">
|
||||||
<view class="section-title">安装说明</view>
|
<view class="section-title">安装说明</view>
|
||||||
@ -330,25 +439,10 @@
|
|||||||
<input class="value" disabled="{{dis3}}" value="{{msg2}}" bindinput="updateInstructions2" placeholder="请输入更换说明" />
|
<input class="value" disabled="{{dis3}}" value="{{msg2}}" bindinput="updateInstructions2" placeholder="请输入更换说明" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<view class="section" wx:if="{{type == 3}}">
|
<view class="section" wx:if="{{type == 3}}">
|
||||||
<view class="section-title">拆除说明</view>
|
<view class="section-title">拆除说明</view>
|
||||||
<view class="info-item">
|
|
||||||
<text class="label">说明:</text>
|
|
||||||
<input class="value" disabled="{{uninstalldis}}" value="{{uninstallMsg}}" bindinput="updateInstructions3" placeholder="请输入拆除说明" />
|
|
||||||
</view>
|
|
||||||
|
|
||||||
|
|
||||||
<view class="info-item" >
|
|
||||||
<text class="label">拆除时间:</text>
|
|
||||||
<input class="value" wx:if="{{uninstallDesc.status == 2}}" bind:tap="changeUninstallDate" value="{{uninstall_time}}" disabled="{{!uninstalldis}}" placeholder="请选择拆除时间" />
|
|
||||||
<input class="value" wx:if="{{uninstallDesc.status != 2}}" value="{{uninstall_time}}" disabled="{{!uninstalldis}}" placeholder="请选择拆除时间" />
|
|
||||||
</view>
|
|
||||||
|
|
||||||
|
|
||||||
<view class="label">拆除图片</view>
|
<view class="label">拆除图片</view>
|
||||||
<view class="installation-images" style="margin-top: 10rpx;">
|
<view class="installation-images" style="margin-top: 10rpx;margin-bottom: 20rpx;">
|
||||||
<block wx:for="{{imgList}}" wx:key="index">
|
<block wx:for="{{imgList}}" wx:key="index">
|
||||||
<view class="image-container">
|
<view class="image-container">
|
||||||
<image class="installation-image" src="{{item}}" mode="aspectFill" />
|
<image class="installation-image" src="{{item}}" mode="aspectFill" />
|
||||||
@ -361,23 +455,34 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">说明:</text>
|
||||||
|
<input class="value" disabled="{{uninstalldis}}" value="{{uninstallMsg}}" bindinput="updateInstructions3" placeholder="请输入拆除说明" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">拆除时间:</text>
|
||||||
|
<input class="value" wx:if="{{uninstallDesc.status == 2}}" bind:tap="changeUninstallDate" value="{{uninstall_time}}" disabled="{{!uninstalldis}}" placeholder="请选择拆除时间" />
|
||||||
|
<input class="value" wx:if="{{uninstallDesc.status != 2}}" value="{{uninstall_time}}" disabled="{{!uninstalldis}}" placeholder="请选择拆除时间" />
|
||||||
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
|
|
||||||
<!-- 完成按钮 -->
|
<!-- 完成按钮 -->
|
||||||
<view class="complete-btn-container" wx:if="{{type == 0 && !dis1 }}">
|
<view class="complete-btn-container" wx:if="{{type == 0 && !dis1 }}">
|
||||||
<button class="complete-btn cancel-btn" bindtap="cancelNewOrder">撤销</button>
|
<button class="complete-btn cancel-btn" bindtap="cancelNewOrder" wx:if="{{(newOrderDesc.status == 3 || newOrderDesc.status == 2 || newOrderDesc.status == 1)}}">撤销</button>
|
||||||
<button class="complete-btn" bindtap="completeNewOrder" wx:if="{{(newOrderDesc.status == 2 || newOrderDesc.status == 1)}}">完成</button>
|
<button class="complete-btn" bindtap="completeNewOrder" wx:if="{{(newOrderDesc.status == 2 || newOrderDesc.status == 1)}}">完成</button>
|
||||||
<button class="complete-btn " bindtap="jihuoItem" wx:if="{{newOrderDesc.status == 3}}">激活</button>
|
<button class="complete-btn " bindtap="jihuoItem" wx:if="{{newOrderDesc.status == 3}}">激活</button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="complete-btn-container" wx:if="{{type == 1 && !dis2 }}">
|
<view class="complete-btn-container" wx:if="{{type == 1 && !dis2 }}">
|
||||||
<button class="complete-btn cancel-btn" bindtap="completeRepairOrder" data-type="4">撤销</button>
|
<button class="complete-btn cancel-btn" bindtap="completeRepairOrder" data-type="4" if>撤销</button>
|
||||||
<button class="complete-btn" bindtap="completeRepairOrder" data-type="3">完成</button>
|
<button class="complete-btn" bindtap="completeRepairOrder" data-type="3">完成</button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="complete-btn-container" wx:if="{{type == 2 && !dis3 }}">
|
<view class="complete-btn-container" wx:if="{{type == 2 && !dis3 }}">
|
||||||
<button class="complete-btn cancel-btn" bindtap="completePartOrder" data-type="4">撤销</button>
|
<button class="complete-btn cancel-btn" bindtap="completePartOrder" data-type="4" if>撤销</button>
|
||||||
<button class="complete-btn" bindtap="completePartOrder" data-type="3">完成</button>
|
<button class="complete-btn" bindtap="completePartOrder" data-type="3">完成</button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|||||||
@ -15,6 +15,14 @@
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
}
|
}
|
||||||
|
.section-title2{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.section-title2_status{
|
||||||
|
font-size: 26rpx !important;
|
||||||
|
}
|
||||||
|
|
||||||
.info-item {
|
.info-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -33,11 +41,16 @@
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
white-space: wrap;
|
white-space: wrap;
|
||||||
|
text-align: right;
|
||||||
|
overflow-x: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-image {
|
.product-image {
|
||||||
margin: 32rpx 0;
|
margin: 32rpx 0;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
width: 300rpx;
|
||||||
|
height: 300rpx;
|
||||||
|
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-image image {
|
.product-image image {
|
||||||
@ -67,7 +80,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.cancel-btn {
|
.cancel-btn {
|
||||||
background: #999;
|
background: #F56C6C;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -131,13 +144,24 @@
|
|||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.item4{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.value2 {
|
.value2 {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: flex-end;
|
||||||
|
align-items: flex-end;
|
||||||
|
}
|
||||||
|
.value2 image{
|
||||||
|
width: 50rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
margin-left: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
width: 240rpx;
|
width: 200rpx;
|
||||||
height: 60rpx;
|
height: 60rpx;
|
||||||
line-height: 60rpx;
|
line-height: 60rpx;
|
||||||
background: #2583FF;
|
background: #2583FF;
|
||||||
|
|||||||
303
packages/partner/pages/OrderMsg/OrderMsg.js
Normal file
303
packages/partner/pages/OrderMsg/OrderMsg.js
Normal file
@ -0,0 +1,303 @@
|
|||||||
|
const app = getApp({ allowDefault: true })
|
||||||
|
let util = require('../../../../utils/util')
|
||||||
|
let apiArr = require('../../../../api/partner')
|
||||||
|
|
||||||
|
Page({
|
||||||
|
data: {
|
||||||
|
newOrderTotal: 200,
|
||||||
|
s: app.system.statusBarHeight, // 状态栏高度
|
||||||
|
n: (app.menu.top - app.system.statusBarHeight) * 2 + app.menu.height, // 导航栏高度
|
||||||
|
t: app.menu.top, // 胶囊局顶部距离
|
||||||
|
h: app.menu.height, // 胶囊高度
|
||||||
|
|
||||||
|
option1: [
|
||||||
|
{ text: '新装工单', value: 0 },
|
||||||
|
{ text: '维修工单', value: 1 },
|
||||||
|
{ text: '拆机工单', value: 3 },
|
||||||
|
{ text: '移机工单', value: 4 },
|
||||||
|
{ text: '滤芯更换工单', value: 2 },
|
||||||
|
],
|
||||||
|
active:0,
|
||||||
|
|
||||||
|
value1: 0,
|
||||||
|
page_num: 1,
|
||||||
|
page_size: 10,
|
||||||
|
flag: false,
|
||||||
|
searchCon: "",
|
||||||
|
NewOrderList: [], //新装工单
|
||||||
|
RepairOrderList: [],//维修工单
|
||||||
|
PartOrderList: [],//滤芯跟换工单
|
||||||
|
UninstallOrderList:[],//拆卸工单
|
||||||
|
RemoveList:[],//移机工单
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
changeActive(e){
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
active:e.currentTarget.dataset.item.value,
|
||||||
|
page_num: 1,
|
||||||
|
NewOrderList: [],
|
||||||
|
RepairOrderList: [],
|
||||||
|
PartOrderList: [],
|
||||||
|
UninstallOrderList:[],
|
||||||
|
})
|
||||||
|
|
||||||
|
if (that.data.active == 0) {
|
||||||
|
that.getNewOrderList()
|
||||||
|
} else if (that.data.active == 1) {
|
||||||
|
that.gerRepairOrderList()
|
||||||
|
} else if(that.data.active == 2){
|
||||||
|
that.getPartOrderList()
|
||||||
|
}else if(that.data.active == 3){
|
||||||
|
this.getUninstallOrder()
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
// 查看工单详情
|
||||||
|
viewOrderDetail(e) {
|
||||||
|
let that = this
|
||||||
|
const id = e.currentTarget.dataset.id;
|
||||||
|
wx.navigateTo({
|
||||||
|
url: `/packages/partner/pages/OrderMsgInfo/OrderMsgInfo?id=${id}&type=${that.data.active}`
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 完成订单
|
||||||
|
completeOrder(e) {
|
||||||
|
const orderId = e.currentTarget.dataset.id;
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '确认完成该订单吗?',
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
this.removeOrder(orderId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 移除已完成的订单
|
||||||
|
removeOrder(orderId) {
|
||||||
|
const newOrderList = this.data.orderList.filter(item => item.id !== orderId);
|
||||||
|
this.setData({
|
||||||
|
orderList: newOrderList
|
||||||
|
});
|
||||||
|
wx.showToast({
|
||||||
|
title: '订单已完成',
|
||||||
|
icon: 'success'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
onLoad() {
|
||||||
|
// 移除原有的wx.setNavigationBarRightButton相关代码
|
||||||
|
let that = this
|
||||||
|
wx.showShareMenu({
|
||||||
|
withShareTicket: true,
|
||||||
|
menus: ['shareAppMessage', 'shareTimeline']
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
flag: false,
|
||||||
|
NewOrderList: [],
|
||||||
|
RepairOrderList: [],
|
||||||
|
PartOrderList: [],
|
||||||
|
UninstallOrderList:[],
|
||||||
|
page_num: 1
|
||||||
|
})
|
||||||
|
that.searchIcon()
|
||||||
|
},
|
||||||
|
|
||||||
|
// 跳转到个人中心
|
||||||
|
navigateToProfile() {
|
||||||
|
console.log(123);
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/packages/master/PersonCen/index'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
//新装工单
|
||||||
|
getNewOrderList() {
|
||||||
|
let that = this
|
||||||
|
wx.showLoading({
|
||||||
|
title: '加载中...',
|
||||||
|
mask:true
|
||||||
|
})
|
||||||
|
util.postUrl4(apiArr.getNewOrder, {
|
||||||
|
info_id: that.data.info_id,
|
||||||
|
search: that.data.searchCon,
|
||||||
|
page_num: that.data.page_num,
|
||||||
|
page_size: that.data.page_size
|
||||||
|
}, res => {
|
||||||
|
console.log(res);
|
||||||
|
wx.hideLoading()
|
||||||
|
if (res.msg == '操作成功') {
|
||||||
|
let flag = false
|
||||||
|
if (res.rows && res.rows.length == that.data.page_size) {
|
||||||
|
flag = true
|
||||||
|
} else {
|
||||||
|
flag = false
|
||||||
|
}
|
||||||
|
that.setData({
|
||||||
|
NewOrderList: that.data.NewOrderList.concat(res.row || []),
|
||||||
|
page_num: that.data.page_num + 1,
|
||||||
|
newOrderTotal: res.total,
|
||||||
|
flag
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//维修工单
|
||||||
|
gerRepairOrderList() {
|
||||||
|
let that = this
|
||||||
|
wx.showLoading({
|
||||||
|
title: '加载中...',
|
||||||
|
mask:true
|
||||||
|
|
||||||
|
})
|
||||||
|
util.postUrl4(apiArr.gerRepairOrder, {
|
||||||
|
info_id: that.data.info_id,
|
||||||
|
page_num: that.data.page_num,
|
||||||
|
page_size: that.data.page_size
|
||||||
|
}, res => {
|
||||||
|
wx.hideLoading()
|
||||||
|
if (res.msg == '操作成功') {
|
||||||
|
let flag = false
|
||||||
|
if (res.rows && res.rows.length == that.data.page_size) {
|
||||||
|
flag = true
|
||||||
|
} else {
|
||||||
|
flag = false
|
||||||
|
}
|
||||||
|
that.setData({
|
||||||
|
RepairOrderList: that.data.RepairOrderList.concat(res.rows || []),
|
||||||
|
page_num: that.data.page_num + 1,
|
||||||
|
flag
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//滤材更换工单
|
||||||
|
getPartOrderList() {
|
||||||
|
let that = this
|
||||||
|
wx.showLoading({
|
||||||
|
title: '加载中...',
|
||||||
|
mask:true
|
||||||
|
|
||||||
|
})
|
||||||
|
util.postUrl4(apiArr.getPartOrder, {
|
||||||
|
info_id: that.data.info_id,
|
||||||
|
page_num: that.data.page_num,
|
||||||
|
page_size: that.data.page_size
|
||||||
|
}, res => {
|
||||||
|
wx.hideLoading()
|
||||||
|
if (res.msg == '操作成功') {
|
||||||
|
let flag = false
|
||||||
|
if (res.rows && res.rows.length == that.data.page_size) {
|
||||||
|
flag = true
|
||||||
|
} else {
|
||||||
|
flag = false
|
||||||
|
}
|
||||||
|
that.setData({
|
||||||
|
PartOrderList: that.data.PartOrderList.concat(res.rows || []),
|
||||||
|
page_num: that.data.page_num + 1,
|
||||||
|
flag
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//拆除工单
|
||||||
|
getUninstallOrder() {
|
||||||
|
let that = this
|
||||||
|
wx.showLoading({
|
||||||
|
title: '加载中...',
|
||||||
|
mask:true
|
||||||
|
})
|
||||||
|
util.postUrl4(apiArr.getUninstallOrder, {
|
||||||
|
info_id: that.data.info_id,
|
||||||
|
status: 0,
|
||||||
|
page_num: that.data.page_num,
|
||||||
|
page_size: that.data.page_size
|
||||||
|
}, res => {
|
||||||
|
wx.hideLoading()
|
||||||
|
if (res.msg == '操作成功') {
|
||||||
|
let flag = false
|
||||||
|
if (res.rows && res.rows.length == that.data.page_size) {
|
||||||
|
flag = true
|
||||||
|
} else {
|
||||||
|
flag = false
|
||||||
|
}
|
||||||
|
that.setData({
|
||||||
|
UninstallOrderList: that.data.UninstallOrderList.concat(res.row || []),
|
||||||
|
page_num: that.data.page_num + 1,
|
||||||
|
flag
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
searchIcon() {
|
||||||
|
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
flag: false,
|
||||||
|
NewOrderList: [],
|
||||||
|
RepairOrderList: [],
|
||||||
|
PartOrderList: [],
|
||||||
|
UninstallOrderList:[],
|
||||||
|
page_num: 1
|
||||||
|
})
|
||||||
|
if (that.data.active == 0) {
|
||||||
|
that.getNewOrderList()
|
||||||
|
} else if (that.data.active == 1) {
|
||||||
|
that.gerRepairOrderList()
|
||||||
|
} else if(that.data.active == 2){
|
||||||
|
that.getPartOrderList()
|
||||||
|
}else if(that.data.active == 3){
|
||||||
|
this.getUninstallOrder()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onShareAppMessage(){
|
||||||
|
return {
|
||||||
|
title: '人人爱净水', // 分享卡片标题(必填)
|
||||||
|
path: '/pages/water_filter/water_filter', // 用户点击后跳转的路径(可选,默认当前页)
|
||||||
|
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义图片(可选,比例建议 5:4)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onShareTimeline() {
|
||||||
|
return {
|
||||||
|
title: '人人爱净水', // 自定义标题
|
||||||
|
query: '', // 自定义页面路径中的参数
|
||||||
|
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义分享图片路径
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onReachBottom() {
|
||||||
|
let that = this
|
||||||
|
if (that.data.flag) {
|
||||||
|
that.searchIcon()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
});
|
||||||
4
packages/partner/pages/OrderMsg/OrderMsg.json
Normal file
4
packages/partner/pages/OrderMsg/OrderMsg.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"navigationStyle": "default",
|
||||||
|
"usingComponents": {}
|
||||||
|
}
|
||||||
232
packages/partner/pages/OrderMsg/OrderMsg.wxml
Normal file
232
packages/partner/pages/OrderMsg/OrderMsg.wxml
Normal file
@ -0,0 +1,232 @@
|
|||||||
|
<!-- 将van-dropdown-menu和search-bar包裹在一个view中 -->
|
||||||
|
<view class="fixed-top">
|
||||||
|
|
||||||
|
<view class="navBox">
|
||||||
|
<view class="{{active == item.value?'navItem active':'navItem'}}" data-item="{{item}}" bind:tap="changeActive" wx:for="{{option1}}">{{item.text}}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 原有内容包裹在content中 -->
|
||||||
|
<view class="content">
|
||||||
|
|
||||||
|
<!-- 新装工单 -->
|
||||||
|
<scroll-view class="order-list" scroll-y wx:if="{{active == 0}}">
|
||||||
|
<block wx:for="{{NewOrderList}}">
|
||||||
|
<view class="order-item" wx:key="install_id" data-id="{{item.install_id}}" bind:tap="viewOrderDetail">
|
||||||
|
<!-- 工单基本信息 -->
|
||||||
|
<view class="order-info">
|
||||||
|
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">设备名称:</text>
|
||||||
|
<text class="value">{{item.product_name}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">设备编号:</text>
|
||||||
|
<text class="value">{{item.device_code}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">客户姓名:</text>
|
||||||
|
<text class="value">{{item.customer_name}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">客户手机:</text>
|
||||||
|
<text class="value">{{item.customer_phone}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">预约时间:</text>
|
||||||
|
<text class="value">{{item.appointment_time}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">预约地址:</text>
|
||||||
|
<text class="value">{{item.region}} {{item.address}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">客户备注:</text>
|
||||||
|
<text class="value">{{item.remark}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">工单状态:</text>
|
||||||
|
<text class="value " wx:if="{{item.status == '1'}}">待分配</text>
|
||||||
|
<text class="value " wx:if="{{item.status == '2'}}">安装中</text>
|
||||||
|
<text class="value " wx:if="{{item.status == '3'}}">待激活</text>
|
||||||
|
<text class="value " wx:if="{{item.status == '4'}}">已安装</text>
|
||||||
|
<text class="value " wx:if="{{item.status == '5'}}">忽略</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
</scroll-view>
|
||||||
|
|
||||||
|
<!-- 维修工单 -->
|
||||||
|
<scroll-view class="order-list" scroll-y wx:if="{{active == 1}}">
|
||||||
|
<block wx:for="{{RepairOrderList}}">
|
||||||
|
<view class="order-item" wx:key="install_id" data-id="{{item.repair_id}}" bind:tap="viewOrderDetail">
|
||||||
|
<!-- 工单基本信息 -->
|
||||||
|
<view class="order-info">
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">设备名称:</text>
|
||||||
|
<text class="value">{{item.product_name}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">设备编号:</text>
|
||||||
|
<text class="value">{{item.device_code}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">客户姓名:</text>
|
||||||
|
<text class="value">{{item.customer_name}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">客户手机:</text>
|
||||||
|
<text class="value">{{item.customer_phone}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">预约时间:</text>
|
||||||
|
<text class="value">{{item.appointment_time}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">预约地址:</text>
|
||||||
|
<text class="value">{{item.region}}{{item.address}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">故障说明:</text>
|
||||||
|
<text class="value">{{item.fault_desc}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">工单状态:</text>
|
||||||
|
<text class="value " wx:if="{{item.status == '1'}}">待指派</text>
|
||||||
|
<text class="value " wx:if="{{item.status == '2'}}">待维修</text>
|
||||||
|
<text class="value " wx:if="{{item.status == '3'}}">维修完成</text>
|
||||||
|
<text class="value " wx:if="{{item.status == '4'}}">已取消</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
</scroll-view>
|
||||||
|
|
||||||
|
<!-- 滤材更换工单 -->
|
||||||
|
<scroll-view class="order-list" scroll-y wx:if="{{active == 2}}">
|
||||||
|
<block wx:for="{{PartOrderList}}">
|
||||||
|
<view class="order-item" wx:key="install_id" data-id="{{item.replace_id}}" bind:tap="viewOrderDetail">
|
||||||
|
<!-- 工单基本信息 -->
|
||||||
|
<view class="order-info">
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">设备名称:</text>
|
||||||
|
<text class="value">{{item.device.product_name}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">设备编号:</text>
|
||||||
|
<text class="value">{{item.device_code}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">客户姓名:</text>
|
||||||
|
<text class="value">{{item.customer_name}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">客户手机:</text>
|
||||||
|
<text class="value">{{item.customer_phone}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">预约地址:</text>
|
||||||
|
<text class="value">{{item.region}} {{item.address}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">预约时间:</text>
|
||||||
|
<text class="value">{{item.appointment_time}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">安装说明:</text>
|
||||||
|
<text class="value">{{item.install_desc}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">工单状态:</text>
|
||||||
|
<text class="value " wx:if="{{item.status == '1'}}">待分配</text>
|
||||||
|
<text class="value " wx:if="{{item.status == '2'}}">待更换</text>
|
||||||
|
<text class="value " wx:if="{{item.status == '3'}}">已更换</text>
|
||||||
|
<text class="value " wx:if="{{item.status == '4'}}">已撤销</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
</scroll-view>
|
||||||
|
|
||||||
|
<!-- 拆机工单 -->
|
||||||
|
<scroll-view class="order-list" scroll-y wx:if="{{active == 3}}">
|
||||||
|
<block wx:for="{{UninstallOrderList}}">
|
||||||
|
<view class="order-item" wx:key="uninstall_id" data-id="{{item.uninstall_id}}" bind:tap="viewOrderDetail">
|
||||||
|
<!-- 工单基本信息 -->
|
||||||
|
<view class="order-info">
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">设备名称:</text>
|
||||||
|
<text class="value">{{item.product_name}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">设备编号:</text>
|
||||||
|
<text class="value">{{item.device_code}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">师傅姓名:</text>
|
||||||
|
<text class="value">{{item.repairman_name}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label" style="white-space: normal;">指派人电话:</text>
|
||||||
|
<text class="value">{{item.repairman_phone}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">客户姓名:</text>
|
||||||
|
<text class="value">{{item.customer_name}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">客户手机:</text>
|
||||||
|
<text class="value">{{item.customer_phone}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- <view class="order-field">
|
||||||
|
<text class="label">预约地址:</text>
|
||||||
|
<text class="value">{{item.region}} {{item.address}}</text>
|
||||||
|
</view> -->
|
||||||
|
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">预约时间:</text>
|
||||||
|
<text class="value">{{item.appointment_time}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="order-field">
|
||||||
|
<text class="label">状态:</text>
|
||||||
|
<text class="value" wx:if="{{item.status == 1}}">待指派</text>
|
||||||
|
<text class="value" wx:if="{{item.status == 2}}">待拆机</text>
|
||||||
|
<text class="value" wx:if="{{item.status == 3}}">待操作 </text>
|
||||||
|
<text class="value" wx:if="{{item.status == 4}}">巳完成</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
</scroll-view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<Footer />
|
||||||
211
packages/partner/pages/OrderMsg/OrderMsg.wxss
Normal file
211
packages/partner/pages/OrderMsg/OrderMsg.wxss
Normal file
@ -0,0 +1,211 @@
|
|||||||
|
.container {
|
||||||
|
padding: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-bar {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
background: #f5f5f5;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
padding: 20rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-input {
|
||||||
|
flex: 1;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-icon {
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
margin-left: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-list {
|
||||||
|
height: calc(100vh - 160rpx);
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-item {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
padding: 20rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-field {
|
||||||
|
display: flex;
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label {
|
||||||
|
color: #666;
|
||||||
|
font-size: 28rpx;
|
||||||
|
width: 180rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.value {
|
||||||
|
color: #333;
|
||||||
|
font-size: 28rpx;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-actions {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-btn {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0 40rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
line-height: 60rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.complete-btn {
|
||||||
|
background: #2583FF;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-navbar {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
height: 88rpx;
|
||||||
|
background: #fff;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 0 32rpx;
|
||||||
|
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
|
||||||
|
z-index: 999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navbar-title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navbar-right {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #007aff;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* 新增右下角按钮样式 */
|
||||||
|
.fixed-bottom-right {
|
||||||
|
position: fixed;
|
||||||
|
right: 32rpx;
|
||||||
|
bottom: 32rpx;
|
||||||
|
z-index: 999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.profile-btn {
|
||||||
|
width: 160rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
text-align: center;
|
||||||
|
background: #2583FF;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
box-shadow: 0 4rpx 16rpx rgba(255, 81, 42, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* 新增固定定位样式 */
|
||||||
|
.fixed-top {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 999;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 调整内容区域的上边距 */
|
||||||
|
.content {
|
||||||
|
margin-top: 80rpx;
|
||||||
|
/* 根据实际高度调整 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.search_icon {
|
||||||
|
width: 30rpx;
|
||||||
|
height: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navBox {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 20rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navItem {
|
||||||
|
flex: 1;
|
||||||
|
white-space: nowrap;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #555555;
|
||||||
|
}
|
||||||
|
|
||||||
|
.active {
|
||||||
|
font-weight: bold;
|
||||||
|
position: relative;
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.active::after {
|
||||||
|
content: '';
|
||||||
|
width: 90%;
|
||||||
|
height: 10rpx;
|
||||||
|
background: #2583FF;
|
||||||
|
border-radius: 0rpx 0rpx 0rpx 0rpx;
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
bottom: -8rpx;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn1 {
|
||||||
|
width: 120rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
background-color: #2583ff;
|
||||||
|
color: #fff;
|
||||||
|
flex: unset;
|
||||||
|
}
|
||||||
|
.order-field2{
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn2{
|
||||||
|
width: 120rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
background-color: #2583ff;
|
||||||
|
color: #fff;
|
||||||
|
flex: unset;
|
||||||
|
}
|
||||||
|
.btn3{
|
||||||
|
width: 120rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
background-color: #2583ff;
|
||||||
|
color: #fff;
|
||||||
|
flex: unset;
|
||||||
|
}
|
||||||
736
packages/partner/pages/OrderMsgInfo/OrderMsgInfo.js
Normal file
736
packages/partner/pages/OrderMsgInfo/OrderMsgInfo.js
Normal file
@ -0,0 +1,736 @@
|
|||||||
|
let util = require('../../../../utils/util')
|
||||||
|
let apiArr = require('../../../../api/partner')
|
||||||
|
const app = getApp({ allowDefault: true })
|
||||||
|
|
||||||
|
Page({
|
||||||
|
data: {
|
||||||
|
s: app.system.statusBarHeight, // 状态栏高度
|
||||||
|
n: (app.menu.top - app.system.statusBarHeight) * 2 + app.menu.height, // 导航栏高度
|
||||||
|
t: app.menu.top, // 胶囊局顶部距离
|
||||||
|
h: app.menu.height, // 胶囊高度
|
||||||
|
|
||||||
|
type: "",
|
||||||
|
id: "",
|
||||||
|
newOrderDesc: {},
|
||||||
|
newOrderDateShow: false,
|
||||||
|
newOrderDateAppointment: "",
|
||||||
|
msg: "", //安装说明
|
||||||
|
msg2: "", //更换说明
|
||||||
|
imgList: [],
|
||||||
|
imgList2: [],
|
||||||
|
repairOrderDesc: {},
|
||||||
|
partOrderDesc: {},
|
||||||
|
|
||||||
|
uninstallDesc: {},
|
||||||
|
uninstalldis: false,
|
||||||
|
uninstallMsg: "",
|
||||||
|
UninstallDate: false,
|
||||||
|
uninstall_time: "",
|
||||||
|
|
||||||
|
|
||||||
|
dis1: false,
|
||||||
|
dis2: false,
|
||||||
|
dis3: false,
|
||||||
|
deviceInfo: {
|
||||||
|
device_code: ""
|
||||||
|
},
|
||||||
|
deviceCode: "",
|
||||||
|
|
||||||
|
|
||||||
|
minDate: new Date().getTime(),
|
||||||
|
formatter(type, value) {
|
||||||
|
if (type === 'year') {
|
||||||
|
return `${value}年`;
|
||||||
|
}
|
||||||
|
if (type === 'month') {
|
||||||
|
return `${value}月`;
|
||||||
|
}
|
||||||
|
if (type === 'day') {
|
||||||
|
return `${value}日`;
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
back() {
|
||||||
|
let that = this
|
||||||
|
let pages = getCurrentPages() // 获取页面栈
|
||||||
|
let prevPage = pages[pages.length - 2] // 上一页的实例
|
||||||
|
if(prevPage.route == 'packages/partner/pages/newWorkOrder/newWorkOrder'){
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/packages/partner/pages/device/device',
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
if (that.data.type == 0) {
|
||||||
|
wx.reLaunch({
|
||||||
|
url: '/packages/partner/pages/WorkOrder/WorkOrder',
|
||||||
|
})
|
||||||
|
} else if (that.data.type == 1) {
|
||||||
|
wx.reLaunch({
|
||||||
|
url: '/packages/WaterPurifier/pages/upKeep/upKeep',
|
||||||
|
})
|
||||||
|
} else if (that.data.type == 2) {
|
||||||
|
wx.reLaunch({
|
||||||
|
url: '/packages/partner/pages/partsOrder/partsOrder',
|
||||||
|
})
|
||||||
|
} else if (that.data.type == 3) {
|
||||||
|
wx.reLaunch({
|
||||||
|
url: '/packages/partner/pages/removeOrder/removeOrder',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// 新装///////////////////////////////
|
||||||
|
//输入框
|
||||||
|
updateInstructions(e) {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
msg: e.detail.value
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 上传图片
|
||||||
|
uploadImage() {
|
||||||
|
let that = this
|
||||||
|
wx.showLoading({
|
||||||
|
title: '上传中...',
|
||||||
|
})
|
||||||
|
wx.chooseMedia({
|
||||||
|
count: 9,
|
||||||
|
mediaType: ['image'],
|
||||||
|
success: (res) => {
|
||||||
|
let tempFiles = res.tempFiles.map(file => file.tempFilePath);
|
||||||
|
let imgList = []
|
||||||
|
let imgList2 = []
|
||||||
|
let uploadCount = 0;
|
||||||
|
|
||||||
|
tempFiles.forEach((item, index) => {
|
||||||
|
util.uploadFileUrl(item, res => {
|
||||||
|
res = JSON.parse(res)
|
||||||
|
imgList[index] = util.img_url + res.data.path;
|
||||||
|
imgList2[index] = res.data.path
|
||||||
|
uploadCount++;
|
||||||
|
|
||||||
|
// 所有文件上传完成后更新数据
|
||||||
|
if (uploadCount === tempFiles.length) {
|
||||||
|
that.setData({
|
||||||
|
imgList: imgList,
|
||||||
|
imgList2
|
||||||
|
}, () => {
|
||||||
|
wx.hideLoading();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fail: err => {
|
||||||
|
wx.hideLoading()
|
||||||
|
console.log(err, 999);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 删除图片
|
||||||
|
deleteImage(e) {
|
||||||
|
let that = this
|
||||||
|
const index = e.currentTarget.dataset.index;
|
||||||
|
let imgList = that.data.imgList
|
||||||
|
let imgList2 = that.data.imgList2
|
||||||
|
imgList.splice(index, 1)
|
||||||
|
imgList2.splice(index, 1)
|
||||||
|
this.setData({
|
||||||
|
imgList,
|
||||||
|
imgList2
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getNewOrderDesc() {
|
||||||
|
let that = this
|
||||||
|
wx.showLoading({
|
||||||
|
title: '加载中...',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
util.postUrl4(apiArr.newOrderDesc, { install_id: Number(that.data.id) }, res => {
|
||||||
|
wx.hideLoading()
|
||||||
|
console.log(res);
|
||||||
|
res.product_icon2 = util.img_url + res.product_icon
|
||||||
|
let imgList = ''
|
||||||
|
let newArr = []
|
||||||
|
if (res.install_imgs) {
|
||||||
|
imgList = res.install_imgs.split(",")
|
||||||
|
newArr = []
|
||||||
|
imgList.forEach(item => {
|
||||||
|
newArr.push(util.img_url + item)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
imgList = ''
|
||||||
|
newArr = []
|
||||||
|
}
|
||||||
|
that.setData({
|
||||||
|
newOrderDesc: res,
|
||||||
|
imgList: newArr,
|
||||||
|
msg: res.install_desc,
|
||||||
|
newOrderDateAppointment: res.remaining_days ? res.remaining_days : ''
|
||||||
|
})
|
||||||
|
|
||||||
|
if (res.status == 5) {
|
||||||
|
// that.getDeriveInfo()
|
||||||
|
let imgList2 = ''
|
||||||
|
let imgList = []
|
||||||
|
|
||||||
|
if (res.install_imgs) {
|
||||||
|
console.log(123);
|
||||||
|
imgList2 = res.install_imgs.split(',')
|
||||||
|
imgList = []
|
||||||
|
imgList2.forEach((item, index) => {
|
||||||
|
imgList.push(util.img_url + item)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
console.log(456);
|
||||||
|
imgList2 = []
|
||||||
|
imgList = []
|
||||||
|
}
|
||||||
|
that.setData({
|
||||||
|
msg: res.install_desc,
|
||||||
|
imgList2,
|
||||||
|
imgList,
|
||||||
|
dis1: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
closeNewOrder() {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
newOrderDateShow: !that.data.newOrderDateShow
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeNewAppointment(e) {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
newOrderDateAppointment: e.detail.value
|
||||||
|
})
|
||||||
|
},
|
||||||
|
jihuoItem() {
|
||||||
|
let that = this
|
||||||
|
|
||||||
|
util.postUrl4(apiArr.BeActive, {
|
||||||
|
install_id: that.data.newOrderDesc.install_id,
|
||||||
|
remaining_days: Number(that.data.newOrderDateAppointment)
|
||||||
|
}, res => {
|
||||||
|
console.log(res);
|
||||||
|
if (res.msg == '操作成功') {
|
||||||
|
wx.showToast({
|
||||||
|
title: '激活成功!',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
that.back()
|
||||||
|
}, 1500)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
completeNewOrder() {
|
||||||
|
let that = this
|
||||||
|
let content = '确认完成该工单吗?'
|
||||||
|
|
||||||
|
if (!that.data.msg) {
|
||||||
|
return wx.showToast({
|
||||||
|
title: '请填写安装说明',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!that.data.deviceInfo.device_code) {
|
||||||
|
return wx.showToast({
|
||||||
|
title: '请扫设备二维码或填写设备编码',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!that.data.imgList.length) {
|
||||||
|
return wx.showToast({
|
||||||
|
title: '请上传安装图片',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: content,
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
util.postUrl4(apiArr.completeNewOrder, {
|
||||||
|
install_id: Number(that.data.id),
|
||||||
|
status: 3,
|
||||||
|
install_desc: that.data.msg,
|
||||||
|
install_imgs: that.data.imgList2.join(','),
|
||||||
|
install_time: util.getCurrentTime(),
|
||||||
|
device_id: that.data.deviceInfo.device_id,
|
||||||
|
product_id: that.data.deviceInfo.product_id
|
||||||
|
}, res => {
|
||||||
|
if (res.msg == '操作成功') {
|
||||||
|
// that.jihuoItem()
|
||||||
|
wx.showToast({
|
||||||
|
title: '创建成功!',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
// wx.navigateBack({
|
||||||
|
// delta: 1
|
||||||
|
// })
|
||||||
|
that.getNewOrderDesc()
|
||||||
|
}, 1500)
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
cancelNewOrder() {
|
||||||
|
let that = this
|
||||||
|
util.postUrl4(apiArr.cancelNewOrder, {
|
||||||
|
install_id: Number(that.data.id),
|
||||||
|
}, res => {
|
||||||
|
wx.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
})
|
||||||
|
if (res.msg == '操作成功') {
|
||||||
|
setTimeout(() => {
|
||||||
|
// wx.navigateBack({
|
||||||
|
// delta: 1
|
||||||
|
// })
|
||||||
|
that.back()
|
||||||
|
}, 1500);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
scanQrcode() {
|
||||||
|
let that = this
|
||||||
|
wx.scanCode({
|
||||||
|
success: (res) => {
|
||||||
|
// 处理扫码结果
|
||||||
|
this.setData({
|
||||||
|
deviceCode: res.result
|
||||||
|
});
|
||||||
|
util.postUrl4(apiArr.getDeviceByCode, {
|
||||||
|
device_code: res.result,
|
||||||
|
install_id: that.data.id
|
||||||
|
}, res => {
|
||||||
|
that.setData({
|
||||||
|
deviceInfo: res
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
wx.showToast({
|
||||||
|
title: '扫码失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
iptDeviceCode(e) {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
"deviceInfo.device_code": e.detail.value
|
||||||
|
})
|
||||||
|
},
|
||||||
|
chooseDevice() {
|
||||||
|
let that = this
|
||||||
|
wx.navigateTo({
|
||||||
|
url: `/packages/partner/pages/chooseDevice/chooseDevice?id=${that.data.id}&product_id=${that.data.newOrderDesc.product_id}`,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 新装///////////////////////////////
|
||||||
|
|
||||||
|
// 维修 ///////////////////////////////
|
||||||
|
getRepairOrderDesc() {
|
||||||
|
let that = this
|
||||||
|
wx.showLoading({
|
||||||
|
title: '加载中...',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
util.postUrl4(apiArr.RepairOrderDesc, {
|
||||||
|
repair_id: that.data.id
|
||||||
|
}, res => {
|
||||||
|
wx.hideLoading()
|
||||||
|
if (res.fault_imgs) {
|
||||||
|
res.fault_imgs = util.img_url + res.fault_imgs
|
||||||
|
}
|
||||||
|
that.setData({
|
||||||
|
repairOrderDesc: res
|
||||||
|
})
|
||||||
|
|
||||||
|
if (res.status == 3 || res.status == 4) {
|
||||||
|
let imgList2 = res.repair_imgs.split(',')
|
||||||
|
let imgList = []
|
||||||
|
imgList2.forEach((item, index) => {
|
||||||
|
imgList.push(util.img_url + item)
|
||||||
|
})
|
||||||
|
console.log(imgList);
|
||||||
|
that.setData({
|
||||||
|
msg: res.repair_desc,
|
||||||
|
imgList,
|
||||||
|
imgList2,
|
||||||
|
dis2: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
completeRepairOrder(e) {
|
||||||
|
let status = Number(e.currentTarget.dataset.type)
|
||||||
|
let that = this
|
||||||
|
let content = '确认完成该工单吗?'
|
||||||
|
if (status == 3) {
|
||||||
|
content = '确认完成该工单吗?'
|
||||||
|
} else {
|
||||||
|
content = '确认撤销该工单吗?'
|
||||||
|
}
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: content,
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
util.postUrl4(apiArr.completeRepairOrder, {
|
||||||
|
repair_id: Number(that.data.id),
|
||||||
|
status,
|
||||||
|
repair_desc: that.data.msg,
|
||||||
|
repair_imgs: that.data.imgList2.join(','),
|
||||||
|
repair_time: util.getCurrentTime()
|
||||||
|
}, res => {
|
||||||
|
wx.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
})
|
||||||
|
if (res.msg == '操作成功') {
|
||||||
|
setTimeout(() => {
|
||||||
|
// wx.navigateBack({
|
||||||
|
// delta: 1
|
||||||
|
// })
|
||||||
|
that.back()
|
||||||
|
}, 1500);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 维修 ///////////////////////////////
|
||||||
|
|
||||||
|
// 滤芯更换 ///////////////////////////////
|
||||||
|
getPartOrderDesc() {
|
||||||
|
let that = this
|
||||||
|
wx.showLoading({
|
||||||
|
title: '加载中...',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
util.postUrl4(apiArr.PartOrderDesc, {
|
||||||
|
replace_id: that.data.id
|
||||||
|
}, res => {
|
||||||
|
wx.hideLoading()
|
||||||
|
that.setData({
|
||||||
|
partOrderDesc: res
|
||||||
|
})
|
||||||
|
|
||||||
|
if (res.status == 3 || res.status == 4) {
|
||||||
|
that.setData({
|
||||||
|
msg2: res.install_desc,
|
||||||
|
dis3: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//没接口
|
||||||
|
completePartOrder(e) {
|
||||||
|
let status = Number(e.currentTarget.dataset.type)
|
||||||
|
let that = this
|
||||||
|
let content = '确认完成该工单吗?'
|
||||||
|
if (status == 3) {
|
||||||
|
content = '确认完成该工单吗?'
|
||||||
|
} else {
|
||||||
|
content = '确认撤销该工单吗?'
|
||||||
|
}
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: content,
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
util.postUrl4(apiArr.completePartOrder, {
|
||||||
|
replace_id: Number(that.data.id),
|
||||||
|
status,
|
||||||
|
install_desc: that.data.msg2,
|
||||||
|
install_time: util.getCurrentTime()
|
||||||
|
}, res => {
|
||||||
|
wx.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
})
|
||||||
|
if (res.msg == '操作成功') {
|
||||||
|
setTimeout(() => {
|
||||||
|
|
||||||
|
if (status == 3) {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/packages/WaterPurifier/pages/device/deviceDesc/deviceDesc?device_id=' + that.data.partOrderDesc.device_id,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/packages/partner/pages/partsOrder/partsOrder',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}, 1500);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
updateInstructions2(e) {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
msg2: e.detail.value
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 滤芯更换 ///////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 拆卸工单详情/////////////////////////////////////////////
|
||||||
|
getUninstallDesc() {
|
||||||
|
let that = this
|
||||||
|
wx.showLoading({
|
||||||
|
title: '加载中...',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
util.postUrl4(apiArr.getUninstallDesc, {
|
||||||
|
uninstall_id: that.data.id
|
||||||
|
}, res => {
|
||||||
|
wx.hideLoading()
|
||||||
|
let uninstalldis = false
|
||||||
|
if (res.status != 2) {
|
||||||
|
uninstalldis = true
|
||||||
|
}
|
||||||
|
|
||||||
|
let imgList = ''
|
||||||
|
let newArr = []
|
||||||
|
if (res.uninstall_imgs) {
|
||||||
|
imgList = res.uninstall_imgs.split(",")
|
||||||
|
imgList.forEach(item => {
|
||||||
|
newArr.push(util.img_url + item)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
imgList = ''
|
||||||
|
newArr = []
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
that.setData({
|
||||||
|
uninstallDesc: res,
|
||||||
|
uninstall_time: res.uninstall_time,
|
||||||
|
uninstallMsg: res.uninstall_desc,
|
||||||
|
imgList: newArr,
|
||||||
|
uninstalldis
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
updateInstructions3(e) {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
uninstallMsg: e.detail.value
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeUninstallDate() {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
UninstallDate: !that.data.UninstallDate
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onInput(event) {
|
||||||
|
let that = this
|
||||||
|
const date = new Date(event.detail); // 获取选中的 Date 对象
|
||||||
|
const year = date.getFullYear(); // 获取年份
|
||||||
|
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,所以需要+1
|
||||||
|
const day = String(date.getDate()).padStart(2, '0');
|
||||||
|
const hours = String(date.getHours()).padStart(2, '0'); // 小时补零
|
||||||
|
const minutes = String(date.getMinutes()).padStart(2, '0'); // 分钟补零
|
||||||
|
const time = `${year}-${month}-${day} ${hours}:${minutes}`;
|
||||||
|
that.setData({
|
||||||
|
uninstall_time: time,
|
||||||
|
UninstallDate: false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onInput2(event) {
|
||||||
|
let that = this
|
||||||
|
const date = new Date(event.detail); // 获取选中的 Date 对象
|
||||||
|
const year = date.getFullYear(); // 获取年份
|
||||||
|
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,所以需要+1
|
||||||
|
const day = String(date.getDate()).padStart(2, '0');
|
||||||
|
const hours = String(date.getHours()).padStart(2, '0'); // 小时补零
|
||||||
|
const minutes = String(date.getMinutes()).padStart(2, '0'); // 分钟补零
|
||||||
|
const time = `${year}-${month}-${day} ${hours}:${minutes}`;
|
||||||
|
that.setData({
|
||||||
|
newOrderDateAppointment: time,
|
||||||
|
newOrderDateShow: false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 拆机
|
||||||
|
uninstallDesc() {
|
||||||
|
let that = this
|
||||||
|
|
||||||
|
if (!that.data.uninstallMsg) {
|
||||||
|
return wx.showToast({
|
||||||
|
title: '请填写拆除说明',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (!that.data.uninstall_time) {
|
||||||
|
return wx.showToast({
|
||||||
|
title: '请选择拆除时间',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (!that.data.imgList.length) {
|
||||||
|
return wx.showToast({
|
||||||
|
title: '请上传拆除图片',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
util.postUrl4(apiArr.unintsall, {
|
||||||
|
uninstall_id: that.data.uninstallDesc.uninstall_id,
|
||||||
|
uninstall_time: that.data.uninstall_time + ':00',
|
||||||
|
uninstall_desc: that.data.uninstallMsg,
|
||||||
|
uninstall_imgs: that.data.imgList2.join(','),
|
||||||
|
}, res => {
|
||||||
|
console.log(res);
|
||||||
|
if (res.msg == '操作成功') {
|
||||||
|
wx.showToast({
|
||||||
|
title: '拆机成功!',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
// wx.navigateBack({
|
||||||
|
// delta: 1
|
||||||
|
// })
|
||||||
|
that.setData({
|
||||||
|
uninstallMsg: "",
|
||||||
|
imgList2: [],
|
||||||
|
imgList: [],
|
||||||
|
uninstall_time: "",
|
||||||
|
})
|
||||||
|
that.getUninstallDesc()
|
||||||
|
}, 1500)
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//报废 入库
|
||||||
|
operate(e) {
|
||||||
|
let that = this
|
||||||
|
let status = e.currentTarget.dataset.type
|
||||||
|
let content = ''
|
||||||
|
if (status == 9) {
|
||||||
|
content = '确定要入库吗'
|
||||||
|
} else {
|
||||||
|
content = '确定要报废吗'
|
||||||
|
}
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: content,
|
||||||
|
complete: (res) => {
|
||||||
|
if (res.cancel) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res.confirm) {
|
||||||
|
util.postUrl4(apiArr.operate, {
|
||||||
|
uninstall_id: that.data.uninstallDesc.uninstall_id,
|
||||||
|
status: status
|
||||||
|
}, res => {
|
||||||
|
wx.showToast({
|
||||||
|
title: '操作成功',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
// wx.navigateBack({
|
||||||
|
// delta: 1
|
||||||
|
// })
|
||||||
|
that.back()
|
||||||
|
}, 1500)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//查询设备实时信息
|
||||||
|
getDeriveInfo() {
|
||||||
|
let that = this
|
||||||
|
util.postUrl4(apiArr.boardInfo, {
|
||||||
|
device_id: that.data.newOrderDesc.device_id
|
||||||
|
}, res => {
|
||||||
|
console.log(res);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
onLoad(options) {
|
||||||
|
let that = this
|
||||||
|
// 这里可以根据options.id来设置不同的假数据
|
||||||
|
const id = options.id;
|
||||||
|
this.setData({
|
||||||
|
id,
|
||||||
|
type: options.type
|
||||||
|
});
|
||||||
|
|
||||||
|
if (options.type == 0) {
|
||||||
|
that.getNewOrderDesc()
|
||||||
|
} else if (options.type == 1) {
|
||||||
|
that.getRepairOrderDesc()
|
||||||
|
} else if (options.type == 2) {
|
||||||
|
that.getPartOrderDesc()
|
||||||
|
} else if (options.type == 3) {
|
||||||
|
that.getUninstallDesc()
|
||||||
|
}
|
||||||
|
|
||||||
|
wx.showShareMenu({
|
||||||
|
withShareTicket: true,
|
||||||
|
menus: ['shareAppMessage', 'shareTimeline']
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
onShareAppMessage() {
|
||||||
|
return {
|
||||||
|
title: '人人爱净水', // 分享卡片标题(必填)
|
||||||
|
path: '/pages/water_filter/water_filter', // 用户点击后跳转的路径(可选,默认当前页)
|
||||||
|
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义图片(可选,比例建议 5:4)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onShareTimeline() {
|
||||||
|
return {
|
||||||
|
title: '人人爱净水', // 自定义标题
|
||||||
|
query: '', // 自定义页面路径中的参数
|
||||||
|
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义分享图片路径
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
4
packages/partner/pages/OrderMsgInfo/OrderMsgInfo.json
Normal file
4
packages/partner/pages/OrderMsgInfo/OrderMsgInfo.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {},
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
538
packages/partner/pages/OrderMsgInfo/OrderMsgInfo.wxml
Normal file
538
packages/partner/pages/OrderMsgInfo/OrderMsgInfo.wxml
Normal file
@ -0,0 +1,538 @@
|
|||||||
|
<view class="container">
|
||||||
|
|
||||||
|
<view class="nav-box" style="padding-top: {{ t }}px;;">
|
||||||
|
<view class="nav-bar" style="height: {{ h }}px;">
|
||||||
|
<view class="nav-bar-left" bind:tap="back">
|
||||||
|
<van-icon name="arrow-left" size="24px" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="nav-bar-title" style="height: {{ h }}px;line-height: {{ h }}px;color: {{color}};font-size: 28rpx;">
|
||||||
|
工单详情
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="nav-bar-right">
|
||||||
|
<van-icon name="arrow-left" size="24px" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 新装工单 -->
|
||||||
|
<block wx:if="{{type == 0}}">
|
||||||
|
<!-- 产品信息 -->
|
||||||
|
<view class="section">
|
||||||
|
<view class="section-title section-title2">
|
||||||
|
工单信息
|
||||||
|
<view class="section-title2_status">
|
||||||
|
<text class="value " wx:if="{{newOrderDesc.status == '1'}}">待分配</text>
|
||||||
|
<text class="value " wx:if="{{newOrderDesc.status == '2'}}">安装中</text>
|
||||||
|
<text class="value " wx:if="{{newOrderDesc.status == '3'}}">待激活</text>
|
||||||
|
<text class="value " wx:if="{{newOrderDesc.status == '4'}}">已安装</text>
|
||||||
|
<text class="value " wx:if="{{newOrderDesc.status == '5'}}">忽略</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">订单编号:</text>
|
||||||
|
<text class="value">{{newOrderDesc.install_no || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">设备编号:</text>
|
||||||
|
<view class="value" bind:tap="chooseDevice" wx:if="{{newOrderDesc.status == 2 && !deviceInfo.device_code}}">选择设备
|
||||||
|
<van-icon name="arrow" />
|
||||||
|
</view>
|
||||||
|
<view class="value" bind:tap="chooseDevice" wx:if="{{newOrderDesc.status == 2 && deviceInfo.device_code}}">{{deviceInfo.device_code}}
|
||||||
|
<van-icon name="arrow" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<text class="value" wx:if="{{newOrderDesc.status != 2}}">{{newOrderDesc.device_code || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">约定时间:</text>
|
||||||
|
<text class="value">{{newOrderDesc.appointment_time || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">客户姓名:</text>
|
||||||
|
<text class="value">{{newOrderDesc.customer_name || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">客户电话:</text>
|
||||||
|
<text class="value">{{newOrderDesc.customer_phone || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">客户地址:</text>
|
||||||
|
<text class="value">{{newOrderDesc.region + newOrderDesc.address || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">创建时间:</text>
|
||||||
|
<text class="value">{{newOrderDesc.create_time || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<view class="info-item" wx:if="{{newOrderDesc.product_icon}}">
|
||||||
|
<text class="label">产品图片:</text>
|
||||||
|
</view>
|
||||||
|
<view class="product-image" wx:if="{{newOrderDesc.product_icon}}">
|
||||||
|
<image src="{{newOrderDesc.product_icon2}}" mode="aspectFit" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">产品名称:</text>
|
||||||
|
<text class="value">{{newOrderDesc.product_name || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 安装图片 -->
|
||||||
|
<view class="section">
|
||||||
|
<view class="section-title">安装图片</view>
|
||||||
|
<view class="installation-images">
|
||||||
|
<block wx:for="{{imgList}}" wx:key="index">
|
||||||
|
<view class="image-container">
|
||||||
|
<image class="installation-image" src="{{item}}" mode="aspectFill" />
|
||||||
|
<view wx:if="{{!dis1 && newOrderDesc.status != 5}}" class="delete-icon" bindtap="deleteImage" data-index="{{index}}">×</view>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
|
||||||
|
<view class="upload-btn" bindtap="uploadImage" wx:if="{{!dis1 && newOrderDesc.status == 2}}">
|
||||||
|
<text>+ 上传图片</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<view class="section">
|
||||||
|
<view class="section-title">安装说明</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">说明:</text>
|
||||||
|
<input class="value" value="{{msg}}" disabled="{{dis1}}" wx:if="{{newOrderDesc.status != 5}}" bindinput="updateInstructions" placeholder="请输入安装说明" />
|
||||||
|
<input class="value" value="{{msg}}" disabled="{{true}}" wx:if="{{newOrderDesc.status == 5}}" bindinput="updateInstructions" placeholder="请输入安装说明" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item" wx:if="{{dis1}}">
|
||||||
|
<text class="label">安装时间:</text>
|
||||||
|
<input class="value" value="{{newOrderDesc.install_time}}" disabled />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- <view class="info-item item4" wx:if="{{newOrderDesc.status != 5 && newOrderDesc.status != 4}}">
|
||||||
|
<text class="label">设备编码</text>
|
||||||
|
|
||||||
|
|
||||||
|
<view class="value value2" wx:if="{{!deviceCode}}">
|
||||||
|
<input type="text" wx:if="{{newOrderDesc.status == 2}}" value="{{deviceInfo.device_code}}" bindinput="iptDeviceCode" placeholder="请输入设备编码" />
|
||||||
|
<view class="btn" bind:tap="scanQrcode" wx:if="{{newOrderDesc.status == '2'}}">去扫码</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="value value2" wx:if="{{deviceCode}}">
|
||||||
|
<input type="text" wx:if="{{newOrderDesc.status == 2}}" value="{{deviceInfo.device_code}}" placeholder="请输入设备编码" />
|
||||||
|
<view class="btn" bind:tap="scanQrcode">重新扫码</view>
|
||||||
|
</view>
|
||||||
|
</view> -->
|
||||||
|
|
||||||
|
<view class="info-item" wx:if="{{newOrderDesc.status == 3}}">
|
||||||
|
<text class="label">剩余天数:</text>
|
||||||
|
<input class="value" type="number" bindinput="changeNewAppointment" placeholder="请输入剩余天数" value="{{newOrderDateAppointment}}" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</block>
|
||||||
|
|
||||||
|
<!-- 维修工单 -->
|
||||||
|
<block wx:if="{{type == 1}}">
|
||||||
|
<!-- 产品信息 -->
|
||||||
|
<view class="section">
|
||||||
|
<view class="section-title section-title2">
|
||||||
|
工单信息
|
||||||
|
<view class="section-title2_status">
|
||||||
|
<text class="value " wx:if="{{repairOrderDesc.status == '1'}}">待指派</text>
|
||||||
|
<text class="value " wx:if="{{repairOrderDesc.status == '2'}}">待维修</text>
|
||||||
|
<text class="value " wx:if="{{repairOrderDesc.status == '3'}}">维修完成</text>
|
||||||
|
<text class="value " wx:if="{{repairOrderDesc.status == '4'}}">已取消</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">订单编号:</text>
|
||||||
|
<text class="value">{{repairOrderDesc.repair_no || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">产品名称:</text>
|
||||||
|
<text class="value">{{repairOrderDesc.product_name || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">设备编号:</text>
|
||||||
|
<text class="value">{{repairOrderDesc.device_code || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">约定时间:</text>
|
||||||
|
<text class="value">{{repairOrderDesc.appointment_time || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">客户姓名:</text>
|
||||||
|
<text class="value">{{repairOrderDesc.customer_name || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">客户电话:</text>
|
||||||
|
<text class="value">{{repairOrderDesc.customer_phone || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">客户地址:</text>
|
||||||
|
<text class="value">{{repairOrderDesc.region + repairOrderDesc.address || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">故障说明:</text>
|
||||||
|
<text class="value">{{repairOrderDesc.fault_desc || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">工单来源:</text>
|
||||||
|
<text class="value" wx:if="{{repairOrderDesc.order_source == 1}}">系统</text>
|
||||||
|
<text class="value" wx:if="{{repairOrderDesc.order_source == 2}}">微信</text>
|
||||||
|
<text class="value" wx:if="{{repairOrderDesc.order_source == 3}}">后台</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">创建时间:</text>
|
||||||
|
<text class="value">{{repairOrderDesc.create_time || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">故障图片:</text>
|
||||||
|
<text class="value" wx:if="{{!repairOrderDesc.fault_imgs}}">暂无数据图片</text>
|
||||||
|
</view>
|
||||||
|
<view class="product-image" wx:if="{{repairOrderDesc.fault_imgs}}">
|
||||||
|
<image src="{{repairOrderDesc.fault_imgs}}" mode="aspectFit" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="section">
|
||||||
|
<view class="section-title">维修说明</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">说明:</text>
|
||||||
|
<input class="value" value="{{msg}}" disabled="{{dis2}}" bindinput="updateInstructions" placeholder="请输入维修说明" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item" wx:if="{{dis2}}">
|
||||||
|
<text class="label">维修时间:</text>
|
||||||
|
<input class="value" value="{{repairOrderDesc.repair_time}}" disabled />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<!-- 安装图片 -->
|
||||||
|
<view class="section">
|
||||||
|
<view class="section-title">维修图片</view>
|
||||||
|
<view class="installation-images">
|
||||||
|
<block wx:for="{{imgList}}" wx:key="index">
|
||||||
|
<view class="image-container">
|
||||||
|
<image class="installation-image" src="{{item}}" mode="aspectFill" />
|
||||||
|
<view wx:if="{{!dis2}}" class="delete-icon" bindtap="deleteImage" data-index="{{index}}">×</view>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
<view class="upload-btn" bindtap="uploadImage" wx:if="{{!dis2}}">
|
||||||
|
<text>+ 上传图片</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
|
||||||
|
<!-- 滤芯更换 -->
|
||||||
|
<block wx:if="{{type == 2}}">
|
||||||
|
<!-- 产品信息 -->
|
||||||
|
<view class="section">
|
||||||
|
<view class="section-title section-title2">
|
||||||
|
工单信息
|
||||||
|
<view class="section-title2_status">
|
||||||
|
<text class="value" wx:if="{{partOrderDesc.status == '1'}}">待分配</text>
|
||||||
|
<text class="value" wx:if="{{partOrderDesc.status == '2'}}">待更换</text>
|
||||||
|
<text class="value" wx:if="{{partOrderDesc.status == '3'}}">已更换</text>
|
||||||
|
<text class="value" wx:if="{{partOrderDesc.status == '4'}}">已撤销</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">订单编号:</text>
|
||||||
|
<text class="value">{{partOrderDesc.replace_no || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">配件名称:</text>
|
||||||
|
<text class="value">
|
||||||
|
<text wx:for="{{partOrderDesc.parts_list}}" wx:key="index">{{item.parts_name}}</text>
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">设备编号:</text>
|
||||||
|
<text class="value">{{partOrderDesc.device_code || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">约定时间:</text>
|
||||||
|
<text class="value">{{partOrderDesc.appointment_time || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">客户姓名:</text>
|
||||||
|
<text class="value">{{partOrderDesc.customer_name || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">客户电话:</text>
|
||||||
|
<text class="value">{{partOrderDesc.customer_phone || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">客户地址:</text>
|
||||||
|
<text class="value">{{partOrderDesc.region + partOrderDesc.address || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">师傅姓名:</text>
|
||||||
|
<text class="value">{{partOrderDesc.master_info.name || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">师傅电话:</text>
|
||||||
|
<text class="value">{{partOrderDesc.master_info.phone || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">工单来源:</text>
|
||||||
|
<text class="value" wx:if="{{repairOrderDesc.order_source == 1}}">系统</text>
|
||||||
|
<text class="value" wx:if="{{repairOrderDesc.order_source == 2}}">微信</text>
|
||||||
|
<text class="value" wx:if="{{repairOrderDesc.order_source == 3}}">后台</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">天数阈值:</text>
|
||||||
|
<text class="value">{{partOrderDesc.threshold}}天</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">水量阈值:</text>
|
||||||
|
<text class="value">{{partOrderDesc.threshold_volume}}升</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">创建时间:</text>
|
||||||
|
<text class="value">{{partOrderDesc.create_time || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="section" wx:if="{{type == 1}}">
|
||||||
|
<view class="section-title">安装说明</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">说明:</text>
|
||||||
|
<input class="value" disabled="{{dis3}}" value="{{msg}}" bindinput="updateInstructions" placeholder="请输入安装说明" />
|
||||||
|
</view>
|
||||||
|
<view class="info-item" wx:if="{{dis3}}">
|
||||||
|
<text class="label">安装时间:</text>
|
||||||
|
<input class="value" value="{{partOrderDesc.install_time}}" disabled />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="section" wx:if="{{type == 2}}">
|
||||||
|
<view class="section-title">更换说明</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">说明:</text>
|
||||||
|
<input class="value" disabled="{{dis3}}" value="{{msg2}}" bindinput="updateInstructions2" placeholder="请输入更换说明" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="section" wx:if="{{type == 2}}">
|
||||||
|
<view class="section-title">更换耗材</view>
|
||||||
|
<view wx:for="{{partOrderDesc.parts_list}}">
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">耗材名称:</text>
|
||||||
|
<text class="value">{{item.parts_name || '暂无数据'}}</text>
|
||||||
|
<text class="value" wx:if="{{partOrderDesc.billing_method == 1}}">剩余天数:{{item.available_days}}</text>
|
||||||
|
<text class="value" wx:if="{{partOrderDesc.billing_method == 2}}">剩余流量:{{item.available_volume}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</block>
|
||||||
|
|
||||||
|
<!-- 拆机工单 -->
|
||||||
|
<block wx:if="{{type == 3}}">
|
||||||
|
<!-- 产品信息 -->
|
||||||
|
<view class="section">
|
||||||
|
<view class="section-title section-title2">
|
||||||
|
工单信息
|
||||||
|
|
||||||
|
<view class="section-title2_status">
|
||||||
|
<!-- 工单状态 -->
|
||||||
|
<!-- -->
|
||||||
|
<text class="value " wx:if="{{uninstallDesc.status == '2'}}">待拆机</text>
|
||||||
|
<text class="value " wx:if="{{uninstallDesc.status == '3'}}">待操作</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">订单编号:</text>
|
||||||
|
<text class="value">{{uninstallDesc.uninstall_no || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">产品名称:</text>
|
||||||
|
<text class="value">{{uninstallDesc.product_name || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">设备编号:</text>
|
||||||
|
<text class="value">{{uninstallDesc.device_code || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">客户姓名:</text>
|
||||||
|
<text class="value">{{uninstallDesc.customer_name}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">客户手机:</text>
|
||||||
|
<text class="value">{{uninstallDesc.customer_phone}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">预约时间:</text>
|
||||||
|
<text class="value">{{uninstallDesc.region + uninstallDesc.address || "暂无数据" }}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">预约时间:</text>
|
||||||
|
<text class="value">{{uninstallDesc.appointment_time}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">师傅姓名:</text>
|
||||||
|
<text class="value">{{uninstallDesc.repairman_name || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">师傅手机:</text>
|
||||||
|
<text class="value">{{uninstallDesc.repairman_phone || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">创建时间:</text>
|
||||||
|
<text class="value">{{uninstallDesc.create_time || '暂无数据'}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="section" wx:if="{{type == 1}}">
|
||||||
|
<view class="section-title">安装说明</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">说明:</text>
|
||||||
|
<input class="value" disabled="{{dis3}}" value="{{msg}}" bindinput="updateInstructions" placeholder="请输入安装说明" />
|
||||||
|
</view>
|
||||||
|
<view class="info-item" wx:if="{{dis3}}">
|
||||||
|
<text class="label">安装时间:</text>
|
||||||
|
<input class="value" value="{{partOrderDesc.install_time}}" disabled />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="section" wx:if="{{type == 2}}">
|
||||||
|
<view class="section-title">更换说明</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">说明:</text>
|
||||||
|
<input class="value" disabled="{{dis3}}" value="{{msg2}}" bindinput="updateInstructions2" placeholder="请输入更换说明" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="section" wx:if="{{type == 3}}">
|
||||||
|
<view class="section-title">拆除说明</view>
|
||||||
|
<view class="label">拆除图片</view>
|
||||||
|
<view class="installation-images" style="margin-top: 10rpx;margin-bottom: 20rpx;">
|
||||||
|
<block wx:for="{{imgList}}" wx:key="index">
|
||||||
|
<view class="image-container">
|
||||||
|
<image class="installation-image" src="{{item}}" mode="aspectFill" />
|
||||||
|
<view wx:if="{{!uninstalldis}}" class="delete-icon" bindtap="deleteImage" data-index="{{index}}">×</view>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
|
||||||
|
<view class="upload-btn" bindtap="uploadImage" wx:if="{{!uninstalldis}}">
|
||||||
|
<text>+ 上传图片</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">说明:</text>
|
||||||
|
<input class="value" disabled="{{uninstalldis}}" value="{{uninstallMsg}}" bindinput="updateInstructions3" placeholder="请输入拆除说明" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="label">拆除时间:</text>
|
||||||
|
<input class="value" wx:if="{{uninstallDesc.status == 2}}" bind:tap="changeUninstallDate" value="{{uninstall_time}}" disabled="{{!uninstalldis}}" placeholder="请选择拆除时间" />
|
||||||
|
<input class="value" wx:if="{{uninstallDesc.status != 2}}" value="{{uninstall_time}}" disabled="{{!uninstalldis}}" placeholder="请选择拆除时间" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
|
||||||
|
<!-- 完成按钮 -->
|
||||||
|
<view class="complete-btn-container" wx:if="{{type == 0 && !dis1 }}">
|
||||||
|
<button class="complete-btn cancel-btn" bindtap="cancelNewOrder" wx:if="{{(newOrderDesc.status == 3 || newOrderDesc.status == 2 || newOrderDesc.status == 1)}}">撤销</button>
|
||||||
|
<button class="complete-btn" bindtap="completeNewOrder" wx:if="{{(newOrderDesc.status == 2 || newOrderDesc.status == 1)}}">完成</button>
|
||||||
|
<button class="complete-btn " bindtap="jihuoItem" wx:if="{{newOrderDesc.status == 3}}">激活</button>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="complete-btn-container" wx:if="{{type == 1 && !dis2 }}">
|
||||||
|
<button class="complete-btn cancel-btn" bindtap="completeRepairOrder" data-type="4" if>撤销</button>
|
||||||
|
<button class="complete-btn" bindtap="completeRepairOrder" data-type="3">完成</button>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="complete-btn-container" wx:if="{{type == 2 && !dis3 }}">
|
||||||
|
<button class="complete-btn cancel-btn" bindtap="completePartOrder" data-type="4" if>撤销</button>
|
||||||
|
<button class="complete-btn" bindtap="completePartOrder" data-type="3">完成</button>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<view class="complete-btn-container" wx:if="{{type == 3 }}">
|
||||||
|
<block wx:if="{{uninstallDesc.status == '2'}}">
|
||||||
|
<button class="complete-btn" bindtap="uninstallDesc">拆机</button>
|
||||||
|
</block>
|
||||||
|
|
||||||
|
<block wx:if="{{uninstallDesc.status == '3'}}">
|
||||||
|
<button class="complete-btn cancel-btn" bindtap="operate" data-type="7">报废</button>
|
||||||
|
<button class="complete-btn" bindtap="operate" data-type="9">入库</button>
|
||||||
|
</block>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<van-popup show="{{ UninstallDate }}" bind:close="changeUninstallDate" safe-area-inset-bottom position="bottom" close-on-click-overlay>
|
||||||
|
<van-datetime-picker bind:cancel="changeUninstallDate" formatter="{{ formatter }}" type="datetime" min-date="{{ minDate }}" bind:confirm="onInput" />
|
||||||
|
</van-popup>
|
||||||
|
|
||||||
|
|
||||||
|
<van-popup show="{{ newOrderDateShow }}" bind:close="closeNewOrder" safe-area-inset-bottom position="bottom" close-on-click-overlay>
|
||||||
|
<van-datetime-picker title="请选择上门时间" bind:cancel="closeNewOrder" formatter="{{ formatter }}" type="datetime" min-date="{{ minDate }}" bind:confirm="onInput2" />
|
||||||
|
</van-popup>
|
||||||
184
packages/partner/pages/OrderMsgInfo/OrderMsgInfo.wxss
Normal file
184
packages/partner/pages/OrderMsgInfo/OrderMsgInfo.wxss
Normal file
@ -0,0 +1,184 @@
|
|||||||
|
.container {
|
||||||
|
padding: 20rpx;
|
||||||
|
padding-top: 0;
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
|
.nav-box{
|
||||||
|
padding-bottom: 30rpx;
|
||||||
|
}
|
||||||
|
.nav-bar-right{
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section {
|
||||||
|
margin-bottom: 40rpx;
|
||||||
|
padding: 20rpx;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
|
||||||
|
margin-left: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
.section-title2{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.section-title2_status{
|
||||||
|
font-size: 26rpx !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-item {
|
||||||
|
display: flex;
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label {
|
||||||
|
color: #666;
|
||||||
|
font-size: 28rpx;
|
||||||
|
width: 160rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.value {
|
||||||
|
color: #333;
|
||||||
|
font-size: 28rpx;
|
||||||
|
flex: 1;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: wrap;
|
||||||
|
text-align: right;
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-image {
|
||||||
|
margin: 32rpx 0;
|
||||||
|
text-align: center;
|
||||||
|
width: 300rpx;
|
||||||
|
height: 300rpx;
|
||||||
|
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-image image {
|
||||||
|
width: 300rpx;
|
||||||
|
height: 300rpx;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.complete-btn-container {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 32rpx;
|
||||||
|
left: 32rpx;
|
||||||
|
right: 32rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.complete-btn {
|
||||||
|
width: 48%;
|
||||||
|
height: 80rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
background: #2583FF;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cancel-btn {
|
||||||
|
background: #F56C6C;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.installation-images {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.installation-image {
|
||||||
|
width: 210rpx;
|
||||||
|
height: 210rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.image-container {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 16rpx;
|
||||||
|
/* 图片间距 */
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-item {
|
||||||
|
width: calc((100% - 32rpx) / 3);
|
||||||
|
/* 每行显示3张图片,减去间距 */
|
||||||
|
height: 210rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.delete-icon {
|
||||||
|
position: absolute;
|
||||||
|
top: -10rpx;
|
||||||
|
right: -10rpx;
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
background: #2583FF;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 50%;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 40rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.upload-btn {
|
||||||
|
width: 210rpx;
|
||||||
|
height: 210rpx;
|
||||||
|
border: 2rpx dashed #ccc;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item2 {
|
||||||
|
margin-top: 10rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.item4{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.value2 {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
width: 200rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
line-height: 60rpx;
|
||||||
|
background: #2583FF;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.value3 {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
@ -1,5 +1,6 @@
|
|||||||
let util = require('../../../../utils/util')
|
let util = require('../../../../utils/util')
|
||||||
let apiArr = require('../../../../api/water_filter')
|
let apiArr = require('../../../../api/water_filter')
|
||||||
|
const app = getApp({ allowDefault: true })
|
||||||
|
|
||||||
// packages/WaterPurifier/pages/upKeep/upKeep.js
|
// packages/WaterPurifier/pages/upKeep/upKeep.js
|
||||||
Page({
|
Page({
|
||||||
@ -8,13 +9,17 @@ Page({
|
|||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
admin:"",
|
s: app.system.statusBarHeight, // 状态栏高度
|
||||||
|
n: (app.menu.top - app.system.statusBarHeight) * 2 + app.menu.height, // 导航栏高度
|
||||||
|
t: app.menu.top, // 胶囊局顶部距离
|
||||||
|
h: app.menu.height, // 胶囊高度
|
||||||
|
admin: "",
|
||||||
statusType: {
|
statusType: {
|
||||||
1: '待分配',
|
1: '待分配',
|
||||||
2: '安装中',
|
2: '安装中',
|
||||||
3: '待激活',
|
3: '待激活',
|
||||||
4: '已安装',
|
4: '已安装',
|
||||||
5: '忽略',
|
5: '已撤销',
|
||||||
},
|
},
|
||||||
option1: [
|
option1: [
|
||||||
{ text: '全部', value: 0 },
|
{ text: '全部', value: 0 },
|
||||||
@ -31,41 +36,46 @@ Page({
|
|||||||
],
|
],
|
||||||
value1: 0,
|
value1: 0,
|
||||||
value2: 'a',
|
value2: 'a',
|
||||||
show:false,
|
show: false,
|
||||||
MasterList:[
|
MasterList: [
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
searchText:"",//搜索文字
|
searchText: "",//搜索文字
|
||||||
page_num:1,
|
page_num: 1,
|
||||||
page_size:10,
|
page_size: 10,
|
||||||
total:'',
|
total: '',
|
||||||
deviceList:[],
|
deviceList: [],
|
||||||
sendOrders: {}, // 派单订单
|
sendOrders: {}, // 派单订单
|
||||||
flag:false
|
flag: false
|
||||||
},
|
},
|
||||||
desc(e){
|
back(){
|
||||||
let that = this
|
wx.reLaunch({
|
||||||
wx.navigateTo({
|
url: '/packages/partner/pages/partner',
|
||||||
url: `../orderDesc/orderDesc?install_id=${e.currentTarget.dataset.id}&type=desc`,
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
addWorkOrder(){
|
desc(e) {
|
||||||
|
let that = this
|
||||||
|
wx.navigateTo({
|
||||||
|
url: `/packages/partner/pages/OrderMsgInfo/OrderMsgInfo?id=${e.currentTarget.dataset.id}&type=0`,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
addWorkOrder() {
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: '../newWorkOrder/newWorkOrder',
|
url: '../newWorkOrder/newWorkOrder',
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
onClose(){
|
onClose() {
|
||||||
let that = this
|
let that = this
|
||||||
that.setData({
|
that.setData({
|
||||||
show:false
|
show: false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
dispatch(e){
|
dispatch(e) {
|
||||||
let that = this
|
let that = this
|
||||||
that.setData({
|
that.setData({
|
||||||
show:true,
|
show: true,
|
||||||
sendOrders: e.currentTarget.dataset.item
|
sendOrders: e.currentTarget.dataset.item
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -89,9 +99,9 @@ Page({
|
|||||||
title: '加载中...',
|
title: '加载中...',
|
||||||
mask: true
|
mask: true
|
||||||
})
|
})
|
||||||
util.postUrl4(apiArr.RecallNewRepair,{
|
util.postUrl4(apiArr.RecallNewRepair, {
|
||||||
install_id: item.install_id,
|
install_id: item.install_id,
|
||||||
},res=>{
|
}, res => {
|
||||||
wx.hideLoading()
|
wx.hideLoading()
|
||||||
if (res.error) {
|
if (res.error) {
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
@ -116,54 +126,51 @@ Page({
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
ipt1(e){
|
ipt1(e) {
|
||||||
let that = this
|
let that = this
|
||||||
|
console.log(e);
|
||||||
that.setData({
|
that.setData({
|
||||||
searchText:e.detail.value,
|
searchText: e.detail.value,
|
||||||
page_num:1,
|
|
||||||
flag:false,
|
|
||||||
deviceList:[]
|
|
||||||
})
|
})
|
||||||
that.getNewOrderList()
|
|
||||||
},
|
},
|
||||||
|
|
||||||
search(){
|
search() {
|
||||||
let that = this
|
let that = this
|
||||||
that.setData({
|
that.setData({
|
||||||
page_num:1,
|
page_num: 1,
|
||||||
flag:false,
|
flag: false,
|
||||||
deviceList:[]
|
deviceList: []
|
||||||
})
|
})
|
||||||
that.getNewOrderList()
|
that.getNewOrderList()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
//工单列表
|
//工单列表
|
||||||
getNewOrderList(){
|
getNewOrderList() {
|
||||||
let that = this
|
let that = this
|
||||||
wx.showLoading({
|
wx.showLoading({
|
||||||
title: '加载中...',
|
title: '加载中...',
|
||||||
mask:true,
|
mask: true,
|
||||||
})
|
})
|
||||||
//设置加载状态
|
//设置加载状态
|
||||||
util.postUrl4(apiArr.newOrderList,{
|
util.postUrl4(apiArr.newOrderList, {
|
||||||
page_size:that.data.page_size,
|
page_size: that.data.page_size,
|
||||||
page_num:that.data.page_num,
|
page_num: that.data.page_num,
|
||||||
search:that.data.searchText,
|
dealer_id: that.data.admin.shop_id,
|
||||||
dealer_id: that.data.admin.shop_id
|
search: that.data.searchText,
|
||||||
},res=>{
|
}, res => {
|
||||||
wx.hideLoading()
|
wx.hideLoading()
|
||||||
if(res.row){
|
if (res.row) {
|
||||||
let flag = false
|
let flag = false
|
||||||
if(res.row.length == that.data.page_size){
|
if (res.row.length == that.data.page_size) {
|
||||||
flag = true
|
flag = true
|
||||||
}else{
|
} else {
|
||||||
flag = false
|
flag = false
|
||||||
}
|
}
|
||||||
that.setData({
|
that.setData({
|
||||||
flag,
|
flag,
|
||||||
deviceList:that.data.deviceList.concat(res.row || []),
|
deviceList: that.data.deviceList.concat(res.row || []),
|
||||||
page_num:that.data.page_num +1
|
page_num: that.data.page_num + 1
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -172,30 +179,30 @@ Page({
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 维修师傅列表
|
// 维修师傅列表
|
||||||
getMasterList(){
|
getMasterList() {
|
||||||
let that = this
|
let that = this
|
||||||
util.postUrl4(apiArr.MasterList,{
|
util.postUrl4(apiArr.MasterList, {
|
||||||
page_num:1,
|
page_num: 1,
|
||||||
page_size:50,
|
page_size: 50,
|
||||||
dealer_id:that.data.admin.shop_id
|
dealer_id: that.data.admin.shop_id
|
||||||
},res=>{
|
}, res => {
|
||||||
if(res.rows){
|
if (res.rows) {
|
||||||
res.rows.forEach(item=>{
|
res.rows.forEach(item => {
|
||||||
item.checked = false
|
item.checked = false
|
||||||
item.avatar = util.img_url + item.avatar
|
item.avatar =item.avatar.startsWith('http')?item.avatar: util.img_url + item.avatar
|
||||||
})
|
})
|
||||||
that.setData({
|
that.setData({
|
||||||
MasterList:res.rows
|
MasterList: res.rows
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
selectMaster(e){
|
selectMaster(e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
let that = this
|
let that = this
|
||||||
let MasterList = that.data.MasterList
|
let MasterList = that.data.MasterList
|
||||||
MasterList.forEach(item=>{
|
MasterList.forEach(item => {
|
||||||
item.checked = false
|
item.checked = false
|
||||||
})
|
})
|
||||||
MasterList[e.currentTarget.dataset.index].checked = true
|
MasterList[e.currentTarget.dataset.index].checked = true
|
||||||
@ -204,24 +211,23 @@ Page({
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
cancel(){
|
cancel() {
|
||||||
let that = this
|
let that = this
|
||||||
that.setData({
|
that.setData({
|
||||||
show:false,
|
show: false,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
sure(){
|
sure() {
|
||||||
let that = this
|
let that = this
|
||||||
that.setData({
|
that.setData({
|
||||||
show:false
|
show: false
|
||||||
})
|
})
|
||||||
const { sendOrders, MasterList } = this.data;
|
const { sendOrders, MasterList } = this.data;
|
||||||
const checkedMaster = MasterList.filter((item) => item.checked)[0];
|
const checkedMaster = MasterList.filter((item) => item.checked)[0];
|
||||||
util.postUrl4(apiArr.newInstallAssign, {
|
util.postUrl4(apiArr.newInstallAssign, {
|
||||||
install_id: sendOrders.install_id,
|
install_id: sendOrders.install_id,
|
||||||
master_id: checkedMaster.info_id,
|
master_id: checkedMaster.info_id,
|
||||||
} ,res => {
|
}, res => {
|
||||||
console.log('新装工单 选择修为师傅', res);
|
|
||||||
if (res.error) {
|
if (res.error) {
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
title: '派单失败',
|
title: '派单失败',
|
||||||
@ -234,15 +240,15 @@ Page({
|
|||||||
icon: 'none',
|
icon: 'none',
|
||||||
})
|
})
|
||||||
that.setData({
|
that.setData({
|
||||||
page_num:1,
|
page_num: 1,
|
||||||
flag:false,
|
flag: false,
|
||||||
})
|
})
|
||||||
setTimeout(()=>{
|
setTimeout(() => {
|
||||||
that.setData({
|
that.setData({
|
||||||
deviceList:[]
|
deviceList: []
|
||||||
})
|
})
|
||||||
that.getNewOrderList()
|
that.getNewOrderList()
|
||||||
},1500)
|
}, 1500)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -252,10 +258,8 @@ Page({
|
|||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
let that = this
|
let that = this
|
||||||
that.setData({
|
that.setData({
|
||||||
admin:wx.getStorageSync('admin')
|
admin: wx.getStorageSync('admin')
|
||||||
})
|
})
|
||||||
that.getNewOrderList()
|
|
||||||
|
|
||||||
wx.showShareMenu({
|
wx.showShareMenu({
|
||||||
withShareTicket: true,
|
withShareTicket: true,
|
||||||
menus: ['shareAppMessage', 'shareTimeline']
|
menus: ['shareAppMessage', 'shareTimeline']
|
||||||
@ -273,7 +277,13 @@ Page({
|
|||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onShow() {
|
onShow() {
|
||||||
|
let that = this
|
||||||
|
this.setData({
|
||||||
|
orderList: [],
|
||||||
|
deviceList:[],
|
||||||
|
page_num: 1,
|
||||||
|
})
|
||||||
|
that.getNewOrderList()
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -294,6 +304,17 @@ Page({
|
|||||||
* 页面相关事件处理函数--监听用户下拉动作
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
*/
|
*/
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
|
let that = this
|
||||||
|
|
||||||
|
that.setData({
|
||||||
|
orderList: [],
|
||||||
|
deviceList:[],
|
||||||
|
searchText:"",
|
||||||
|
page_num: 1,
|
||||||
|
flag:false
|
||||||
|
})
|
||||||
|
that.getNewOrderList()
|
||||||
|
wx.stopPullDownRefresh();
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -302,7 +323,7 @@ Page({
|
|||||||
*/
|
*/
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
let that = this
|
let that = this
|
||||||
if(that.data.flag){
|
if (that.data.flag) {
|
||||||
that.getNewOrderList()
|
that.getNewOrderList()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -310,7 +331,7 @@ Page({
|
|||||||
/**
|
/**
|
||||||
* 用户点击右上角分享
|
* 用户点击右上角分享
|
||||||
*/
|
*/
|
||||||
onShareAppMessage(){
|
onShareAppMessage() {
|
||||||
return {
|
return {
|
||||||
title: '人人爱净水', // 分享卡片标题(必填)
|
title: '人人爱净水', // 分享卡片标题(必填)
|
||||||
path: '/pages/water_filter/water_filter', // 用户点击后跳转的路径(可选,默认当前页)
|
path: '/pages/water_filter/water_filter', // 用户点击后跳转的路径(可选,默认当前页)
|
||||||
@ -324,4 +345,4 @@ Page({
|
|||||||
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义分享图片路径
|
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义分享图片路径
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ -2,5 +2,6 @@
|
|||||||
"usingComponents": {
|
"usingComponents": {
|
||||||
"Footer":"/component/footer/index"
|
"Footer":"/component/footer/index"
|
||||||
},
|
},
|
||||||
"navigationBarTitleText": "新装工单"
|
"navigationStyle": "custom",
|
||||||
|
"enablePullDownRefresh": true
|
||||||
}
|
}
|
||||||
@ -1,9 +1,28 @@
|
|||||||
<view class="upkeep">
|
<view class="upkeep">
|
||||||
|
|
||||||
|
<view class="nav-box" style="padding-top: {{ t }}px;">
|
||||||
|
<view class="nav-bar" style="height: {{ h }}px;">
|
||||||
|
<view class="nav-bar-left" bind:tap="back">
|
||||||
|
<van-icon name="arrow-left" size="24px" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="nav-bar-title" style="height: {{ h }}px;line-height: {{ h }}px;color: {{color}};font-size: 28rpx;">
|
||||||
|
新装工单
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="nav-bar-right">
|
||||||
|
<van-icon name="arrow-left" size="24px" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<view class="upkeep_select">
|
<view class="upkeep_select">
|
||||||
<view class="ipt">
|
<view class="ipt">
|
||||||
<input value="{{searchText}}" bindinput="ipt1" type="text" placeholder="工单号/客户名称/客户手机" placeholder-style="color: #999999;font-size: 24rpx;" />
|
<input value="{{searchText}}" confirm-type="search" bindconfirm="search" bindinput="ipt1" type="text" placeholder="设备编号/客户名称/客户手机/客户地址" placeholder-style="color: #999999;font-size: 28rpx;" />
|
||||||
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/dervice/deriveSearch.png?1" mode="widthFix" bind:tap="search" />
|
|
||||||
|
<view class="searchBox" bind:tap="search">
|
||||||
|
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/dervice/deriveSearch.png?1" mode="widthFix" />
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -12,7 +31,7 @@
|
|||||||
<view class="orderItem_tit">工单号:{{item.install_no}}</view>
|
<view class="orderItem_tit">工单号:{{item.install_no}}</view>
|
||||||
|
|
||||||
<view class="orderItem_Item" wx:if="{{item.status == 3 || item.status == 4 || item.status == 5}}">
|
<view class="orderItem_Item" wx:if="{{item.status == 3 || item.status == 4 || item.status == 5}}">
|
||||||
<view class="orderItem_Item_tit">设备号</view>
|
<view class="orderItem_Item_tit">设备编号</view>
|
||||||
<view class="orderItem_Item_con">{{item.device_code}}</view>
|
<view class="orderItem_Item_con">{{item.device_code}}</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -26,18 +45,22 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="orderItem_Item">
|
<view class="orderItem_Item">
|
||||||
<view class="orderItem_Item_tit">工单状态</view>
|
<view class="orderItem_Item_tit">工单状态</view>
|
||||||
<view class="orderItem_Item_con2">{{statusType[item.status]}}</view>
|
<view class="orderItem_Item_con2" wx:if="{{item.status == 1}}">待分配</view>
|
||||||
|
<view class="orderItem_Item_con2" wx:if="{{item.status == 2}}">安装中</view>
|
||||||
|
<view class="orderItem_Item_con2" wx:if="{{item.status == 3}}">待激活</view>
|
||||||
|
<view class="orderItem_Item_con2" wx:if="{{item.status == 4}}">已安装</view>
|
||||||
|
<view class="orderItem_Item_con2" wx:if="{{item.status == 5}}">已撤销</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="orderItem_Item">
|
<view class="orderItem_Item">
|
||||||
<view class="orderItem_Item_tit">具体位置</view>
|
<view class="orderItem_Item_tit">详细地址</view>
|
||||||
<view class="orderItem_Item_con">{{item.region + item.address}}</view>
|
<view class="orderItem_Item_con">{{item.region + item.address || '暂无数据'}}</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="contral">
|
<view class="contral">
|
||||||
<view class="state state2" catchtap="headerRecallClick" data-item="{{item}}" wx:if="{{item.status === 1}}">撤回</view>
|
<view class="state state2" catchtap="headerRecallClick" data-item="{{item}}" wx:if="{{item.status === 1}}">撤回</view>
|
||||||
<view class="state" wx:if="{{item.status === 1}}" data-item="{{item}}" catch:tap="dispatch">派单</view>
|
<view class="state" wx:if="{{item.status === 1}}" data-item="{{item}}" catch:tap="dispatch">派单</view>
|
||||||
<view class="state state3" catch:tap="headerOkClick" wx:if="{{item.status === 3}}">完成</view>
|
<!-- <view class="state state3" catch:tap="headerOkClick" wx:if="{{item.status === 4}}">完成</view> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -55,7 +78,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<view class="selectMaster">
|
<view class="selectMaster">
|
||||||
<van-popup show="{{ show }}" bind:close="onClose" close-on-click-overlay round position="bottom" z-index="99999" >
|
<van-popup show="{{ show }}" bind:close="onClose" close-on-click-overlay round position="bottom" z-index="99999">
|
||||||
<view class="pop_Tit">
|
<view class="pop_Tit">
|
||||||
<view class="cancel" bind:tap="cancel">取消</view>
|
<view class="cancel" bind:tap="cancel">取消</view>
|
||||||
请选择维修师傅
|
请选择维修师傅
|
||||||
@ -66,7 +89,7 @@
|
|||||||
<view class="popItemMaster" wx:for="{{MasterList}}" wx:key="index" bind:tap="selectMaster" data-index="{{index}}">
|
<view class="popItemMaster" wx:for="{{MasterList}}" wx:key="index" bind:tap="selectMaster" data-index="{{index}}">
|
||||||
<view class="popItem_left">
|
<view class="popItem_left">
|
||||||
<view class="MasterAva">
|
<view class="MasterAva">
|
||||||
<image src="{{item.avatar}}" mode="widthFix"/>
|
<image src="{{item.avatar}}" mode="aspectFill" />
|
||||||
</view>
|
</view>
|
||||||
<view class="MasterMsg">
|
<view class="MasterMsg">
|
||||||
<view class="MasterMsg1">
|
<view class="MasterMsg1">
|
||||||
@ -81,7 +104,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="popItem_right">
|
<view class="popItem_right">
|
||||||
<view class="cir1" wx:if="{{item.checked}}"></view>
|
<view class="cir1" wx:if="{{item.checked}}"></view>
|
||||||
<view class="cir2" wx:if="{{!item.checked}}" ></view>
|
<view class="cir2" wx:if="{{!item.checked}}"></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@ -1,6 +1,13 @@
|
|||||||
.upkeep{
|
.upkeep{
|
||||||
padding-bottom: 80rpx;
|
padding-bottom: 80rpx;
|
||||||
}
|
}
|
||||||
|
.nav-box{
|
||||||
|
padding-bottom: 30rpx;
|
||||||
|
}
|
||||||
|
.nav-bar-right{
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.upkeep_select {
|
.upkeep_select {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -9,7 +16,7 @@
|
|||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
color: #222222;
|
color: #222222;
|
||||||
background-color: #F9F9F9;
|
background-color: #F9F9F9;
|
||||||
padding: 30rpx 20rpx;
|
padding: 16rpx 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.upkeep_select .ipt {
|
.upkeep_select .ipt {
|
||||||
@ -18,7 +25,7 @@
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
width: 710rpx;
|
width: 710rpx;
|
||||||
height: 54rpx;
|
height: 98rpx;
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
border-radius: 100rpx 100rpx 100rpx 100rpx;
|
border-radius: 100rpx 100rpx 100rpx 100rpx;
|
||||||
padding-left: 26rpx;
|
padding-left: 26rpx;
|
||||||
@ -27,10 +34,11 @@
|
|||||||
|
|
||||||
.ipt input{
|
.ipt input{
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
height: 100rpx;
|
||||||
}
|
}
|
||||||
.ipt image {
|
.ipt image {
|
||||||
width: 30rpx;
|
width: 42rpx;
|
||||||
height: 30rpx;
|
height: 42rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.orderList {
|
.orderList {
|
||||||
@ -58,7 +66,7 @@
|
|||||||
|
|
||||||
.orderItem_Item_tit {
|
.orderItem_Item_tit {
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 26rpx;
|
font-size: 28rpx;
|
||||||
color: #999999;
|
color: #999999;
|
||||||
min-width: 110rpx;
|
min-width: 110rpx;
|
||||||
margin-right: 30rpx;
|
margin-right: 30rpx;
|
||||||
@ -66,7 +74,7 @@
|
|||||||
|
|
||||||
.orderItem_Item_con {
|
.orderItem_Item_con {
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 26rpx;
|
font-size: 28rpx;
|
||||||
color: #222222;
|
color: #222222;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,6 +243,7 @@
|
|||||||
background: #F9F9F9;
|
background: #F9F9F9;
|
||||||
border-radius: 20rpx 20rpx 20rpx 20rpx;
|
border-radius: 20rpx 20rpx 20rpx 20rpx;
|
||||||
border: 1rpx solid #999999;
|
border: 1rpx solid #999999;
|
||||||
|
overflow: hidden;
|
||||||
margin-right: 30rpx;
|
margin-right: 30rpx;
|
||||||
}
|
}
|
||||||
.MasterAva image{
|
.MasterAva image{
|
||||||
@ -281,3 +290,12 @@
|
|||||||
padding-top: 80rpx;
|
padding-top: 80rpx;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.searchBox{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding-left: 40rpx;
|
||||||
|
height: 70rpx;
|
||||||
|
}
|
||||||
@ -1,5 +1,6 @@
|
|||||||
let util = require('../../../../utils/util')
|
let util = require('../../../../utils/util')
|
||||||
let apiArr = require('../../../../api/partner')
|
let apiArr = require('../../../../api/partner')
|
||||||
|
let apiArr2 = require('../../../../api/water_filter')
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -18,17 +19,137 @@ Page({
|
|||||||
page_num: 1,
|
page_num: 1,
|
||||||
page_size: 50,
|
page_size: 50,
|
||||||
show: false,
|
show: false,
|
||||||
currentDeviceInfo: ""
|
currentDeviceInfo: {
|
||||||
|
region:"",
|
||||||
|
address:"",
|
||||||
|
},
|
||||||
|
formatter(type, value) {
|
||||||
|
if (type === 'year') {
|
||||||
|
return `${value}年`;
|
||||||
|
}
|
||||||
|
if (type === 'month') {
|
||||||
|
return `${value}月`;
|
||||||
|
}
|
||||||
|
if (type === 'day') {
|
||||||
|
return `${value}日`;
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
},
|
||||||
|
show2: false,
|
||||||
|
cityList: [],
|
||||||
|
areaList: [],
|
||||||
|
businessList: [],
|
||||||
|
newAreaList: [], // 默认展示 市区
|
||||||
|
newBusiness: [], // 默认展示 县/区
|
||||||
|
confirmCity: '',
|
||||||
|
confirmArea: '',
|
||||||
|
confirmBusiness: '',
|
||||||
|
deviceInfo:{
|
||||||
|
customer_name:"",
|
||||||
|
customer_phone:"",
|
||||||
|
device_code:"",
|
||||||
|
address:"",
|
||||||
|
region:""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onClose2() {
|
||||||
|
this.setData({
|
||||||
|
show2: false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
headerAreaClick() {
|
||||||
|
this.setData({
|
||||||
|
show2: true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
bindChange(e) {
|
||||||
|
const { value } = e.detail;
|
||||||
|
const { cityList, areaList, businessList } = this.data;
|
||||||
|
// 每次切换时,根据当前点击的省过滤出所属市区,并且试试变化县/区
|
||||||
|
let newArea = areaList.filter((item) => item.city_id === cityList[value[0]].city_id);
|
||||||
|
let newbus = businessList.filter((item) => item.area_id === newArea[value[1]].area_id);
|
||||||
|
this.setData({
|
||||||
|
newAreaList: newArea,
|
||||||
|
newBusiness: newbus,
|
||||||
|
confirmCity: cityList[value[0]],
|
||||||
|
confirmArea: newArea[value[1]],
|
||||||
|
confirmBusiness: newbus[value[2]],
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
onOk() {
|
||||||
|
const { confirmCity, confirmArea, confirmBusiness } = this.data;
|
||||||
|
console.log(confirmCity, confirmArea, confirmBusiness);
|
||||||
|
this.setData({
|
||||||
|
show2: false,
|
||||||
|
"currentDeviceInfo.region": `${confirmCity.name}${confirmArea.area_name}${confirmBusiness.business_name}`,
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getSSQ() {
|
||||||
|
let that = this
|
||||||
|
util.postUrl2(apiArr2.city, {}, res => {
|
||||||
|
util.postUrl2(apiArr2.area, {}, res1 => {
|
||||||
|
util.postUrl2(apiArr2.business, {}, res2 => {
|
||||||
|
wx.hideLoading();
|
||||||
|
// 省列表来自 res
|
||||||
|
let cityList = res.data.data.rows;
|
||||||
|
// 市列表来自 res1
|
||||||
|
let areaList = res1.data.data.rows;
|
||||||
|
// 区列表来自 res2
|
||||||
|
let businessList = res2.data.data.rows;
|
||||||
|
|
||||||
|
// 处理市列表,将衡水市放到最后
|
||||||
|
let hengshuiIndex = areaList.findIndex(item => item.name === '衡水市');
|
||||||
|
console.log(hengshuiIndex, 'hengshuiIndex');
|
||||||
|
if (hengshuiIndex !== -1) {
|
||||||
|
const hengshui = areaList.splice(hengshuiIndex, 1)[0];
|
||||||
|
areaList.push(hengshui);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(businessList);
|
||||||
|
// 处理区列表,将衡水市的桃城区放到最后一个
|
||||||
|
let taochengIndex = businessList.findIndex(item => item.business_name === '桃城区');
|
||||||
|
if (taochengIndex !== -1) {
|
||||||
|
const taocheng = businessList.splice(taochengIndex, 1)[0];
|
||||||
|
businessList.unshift(taocheng);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 默认展示第一条数据的省、市和区
|
||||||
|
let newArea = res1.data.data.rows.filter((item) => {
|
||||||
|
return item.city_id === res.data.data.rows[0].city_id
|
||||||
|
});
|
||||||
|
let newbus = res2.data.data.rows.filter((item) => {
|
||||||
|
return item.area_id === res1.data.data.rows[0].area_id
|
||||||
|
});
|
||||||
|
|
||||||
|
// 正确存储数据
|
||||||
|
wx.setStorageSync('cityList', cityList)
|
||||||
|
wx.setStorageSync('areaList', areaList)
|
||||||
|
wx.setStorageSync('businessList', businessList)
|
||||||
|
|
||||||
|
this.setData({
|
||||||
|
cityList: cityList,
|
||||||
|
areaList: areaList,
|
||||||
|
businessList: businessList,
|
||||||
|
newAreaList: newArea, // 默认展示市
|
||||||
|
newBusiness: newbus, // 默认展示区
|
||||||
|
confirmCity: cityList[0],
|
||||||
|
confirmArea: newArea[0],
|
||||||
|
confirmBusiness: newbus[0],
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
changeShow1() {
|
changeShow1() {
|
||||||
let that = this
|
let that = this
|
||||||
that.setData({
|
wx.navigateTo({
|
||||||
show: true
|
url: '/packages/partner/pages/chooseRepairDevice/chooseRepairDevice',
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getDeviceList() {
|
getDeviceList() {
|
||||||
console.log(apiArr);
|
|
||||||
let that = this
|
let that = this
|
||||||
util.postUrl4(apiArr.deviceList, {
|
util.postUrl4(apiArr.deviceList, {
|
||||||
page_num: that.data.page_num,
|
page_num: that.data.page_num,
|
||||||
@ -40,6 +161,14 @@ Page({
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
changeAddress(e){
|
||||||
|
console.log(e);
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
"currentDeviceInfo.address":e.detail.value
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
updateFault_desc(e) {
|
updateFault_desc(e) {
|
||||||
let that = this
|
let that = this
|
||||||
that.setData({
|
that.setData({
|
||||||
@ -103,11 +232,13 @@ Page({
|
|||||||
fileList2
|
fileList2
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
changeCustomerPhone(e){
|
||||||
|
console.log(e);
|
||||||
|
},
|
||||||
submit() {
|
submit() {
|
||||||
let that = this
|
let that = this
|
||||||
|
|
||||||
if (!that.data.currentDeviceInfo.device_id) {
|
if (!that.data.deviceInfo.device_code) {
|
||||||
return wx.showToast({
|
return wx.showToast({
|
||||||
title: '请选择维修设备',
|
title: '请选择维修设备',
|
||||||
icon: "none"
|
icon: "none"
|
||||||
@ -127,20 +258,20 @@ Page({
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
util.postUrl4(apiArr.createRepairOrder, {
|
util.postUrl4(apiArr.createRepairOrder, {
|
||||||
device_code: that.data.currentDeviceInfo.device_code,
|
device_code: that.data.deviceInfo.device_code,
|
||||||
appointment_time: '',
|
appointment_time: '',
|
||||||
fault_desc: that.data.fault_desc,
|
fault_desc: that.data.fault_desc,
|
||||||
fault_imgs: that.data.fileList2[0].url
|
fault_imgs: that.data.fileList2[0].url,
|
||||||
}, res => {
|
}, res => {
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
title: '创建成功!',
|
title: '创建成功!',
|
||||||
icon: "none"
|
icon: "none"
|
||||||
})
|
})
|
||||||
setTimeout(()=>{
|
setTimeout(() => {
|
||||||
wx.navigateBack({
|
wx.navigateBack({
|
||||||
delta:1
|
delta: 1
|
||||||
})
|
})
|
||||||
},1500)
|
}, 1500)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@ -149,6 +280,31 @@ Page({
|
|||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
let that = this
|
let that = this
|
||||||
that.getDeviceList()
|
that.getDeviceList()
|
||||||
|
if (wx.getStorageSync('cityList') && wx.getStorageSync('areaList') && wx.getStorageSync('businessList')) {
|
||||||
|
let res = wx.getStorageSync('cityList')
|
||||||
|
let res1 = wx.getStorageSync('areaList')
|
||||||
|
let res2 = wx.getStorageSync('businessList')
|
||||||
|
console.log(res1);
|
||||||
|
// 默认展示第一条数据 的市区 和 城区
|
||||||
|
let newArea = res1.filter((item) => {
|
||||||
|
return item.city_id === res[0].city_id
|
||||||
|
});
|
||||||
|
let newbus = res2.filter((item) => {
|
||||||
|
return item.area_id === res1[0].area_id
|
||||||
|
});
|
||||||
|
this.setData({
|
||||||
|
cityList: res,
|
||||||
|
areaList: res1,
|
||||||
|
businessList: res2,
|
||||||
|
newAreaList: newArea, // 默认展示 市区
|
||||||
|
newBusiness: newbus, // 默认展示 县/区
|
||||||
|
confirmCity: res1[0],
|
||||||
|
confirmArea: newArea[0],
|
||||||
|
confirmBusiness: newbus[0],
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
that.getSSQ()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
{
|
{
|
||||||
"usingComponents": {}
|
"usingComponents": {},
|
||||||
|
"navigationBarTitleText": "新增维修工单"
|
||||||
}
|
}
|
||||||
@ -7,7 +7,7 @@
|
|||||||
维修设备
|
维修设备
|
||||||
</view>
|
</view>
|
||||||
<view class="formItem_con" bind:tap="changeShow1">
|
<view class="formItem_con" bind:tap="changeShow1">
|
||||||
<input type="text" placeholder="请选择维修设备" value="{{device_code}}" />
|
<input type="text" disabled placeholder="请选择维修设备" value="{{deviceInfo.device_code}}" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -18,7 +18,7 @@
|
|||||||
用户姓名
|
用户姓名
|
||||||
</view>
|
</view>
|
||||||
<view class="formItem_con">
|
<view class="formItem_con">
|
||||||
<input type="text" disabled placeholder="请输入用户姓名" bindinput="changeCustomerName" value="{{currentDeviceInfo.customer_name}}" />
|
<input type="text" placeholder="请输入用户姓名" bindinput="changeCustomerName" value="{{deviceInfo.customer_name}}" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -28,7 +28,7 @@
|
|||||||
用户电话
|
用户电话
|
||||||
</view>
|
</view>
|
||||||
<view class="formItem_con">
|
<view class="formItem_con">
|
||||||
<input type="number" disabled placeholder="请输入用户电话" maxlength="11" bindinput="changeCustomerPhone" value="{{currentDeviceInfo.customer_phone}}" />
|
<input type="number" placeholder="请输入用户电话" maxlength="11" bindinput="changeCustomerPhone" value="{{deviceInfo.customer_phone}}" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -40,18 +40,17 @@
|
|||||||
所在区域
|
所在区域
|
||||||
</view>
|
</view>
|
||||||
<view class="formItem_con" bind:tap="headerAreaClick">
|
<view class="formItem_con" bind:tap="headerAreaClick">
|
||||||
<input type="text" value="{{currentDeviceInfo.region}}" disabled placeholder='请选择您所在的区域' placeholder-style="font-size: 26rpx;color:#999" />
|
<input type="text" value="{{deviceInfo.region}}" placeholder='请选择您所在的区域' placeholder-style="font-size: 26rpx;color:#999" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<view class="formItem">
|
<view class="formItem">
|
||||||
<view class="formItem_tit">
|
<view class="formItem_tit">
|
||||||
<view class="icon">*</view>
|
<view class="icon">*</view>
|
||||||
详细地址
|
详细地址
|
||||||
</view>
|
</view>
|
||||||
<view class="formItem_con">
|
<view class="formItem_con">
|
||||||
<input type="text" disabled placeholder="请输入详细地址" bindinput="changeAddress" value="{{currentDeviceInfo.address}}" />
|
<input type="text" placeholder="请输入详细地址" bindinput="changeAddress" value="{{deviceInfo.address}}" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -97,7 +96,6 @@
|
|||||||
</van-popup>
|
</van-popup>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<van-popup show="{{ show3 }}" safe-area-inset-bottom lock-scroll bind:close="onClose3" round close-on-click-overlay position="bottom">
|
<van-popup show="{{ show3 }}" safe-area-inset-bottom lock-scroll bind:close="onClose3" round close-on-click-overlay position="bottom">
|
||||||
<van-picker show-toolbar bind:cancel="cancel1" bind:confirm="confirmPackage3" columns="{{ masterList }}" value-key="name" />
|
<van-picker show-toolbar bind:cancel="cancel1" bind:confirm="confirmPackage3" columns="{{ masterList }}" value-key="name" />
|
||||||
</van-popup>
|
</van-popup>
|
||||||
@ -106,3 +104,24 @@
|
|||||||
<van-popup show="{{ show4 }}" bind:close="onClose4" safe-area-inset-bottom position="bottom" close-on-click-overlay>
|
<van-popup show="{{ show4 }}" bind:close="onClose4" safe-area-inset-bottom position="bottom" close-on-click-overlay>
|
||||||
<van-datetime-picker bind:cancel="onClose4" formatter="{{ formatter }}" type="datetime" min-date="{{ minDate }}" bind:confirm="onInput" />
|
<van-datetime-picker bind:cancel="onClose4" formatter="{{ formatter }}" type="datetime" min-date="{{ minDate }}" bind:confirm="onInput" />
|
||||||
</van-popup>
|
</van-popup>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 省市区选择 -->
|
||||||
|
<van-popup show="{{ show2 }}" custom-style="height: 40%;" safe-area-inset-bottom lock-scroll bind:close="onClose2" round close-on-click-overlay position="bottom">
|
||||||
|
<view class="popup_title">
|
||||||
|
<view class="popup_label" bind:tap="onClose2">取消</view>
|
||||||
|
<view class="popup_label color_blue" bind:tap="onOk">确认</view>
|
||||||
|
</view>
|
||||||
|
<picker-view indicator-style="height: 50px;" style="width: 100%; height: 500rpx;" value="{{value}}" bindchange="bindChange">
|
||||||
|
<picker-view-column>
|
||||||
|
<view wx:for="{{cityList}}" wx:key="index" style="line-height: 50px; text-align: center;">{{item.name}}</view>
|
||||||
|
</picker-view-column>
|
||||||
|
<picker-view-column>
|
||||||
|
<view wx:for="{{newAreaList}}" wx:key="index" style="line-height: 50px; text-align: center;">{{item.name}}</view>
|
||||||
|
</picker-view-column>
|
||||||
|
<picker-view-column>
|
||||||
|
<view wx:for="{{newBusiness}}" wx:key="index" style="line-height: 50px; text-align: center;">{{item.business_name}}</view>
|
||||||
|
</picker-view-column>
|
||||||
|
</picker-view>
|
||||||
|
</van-popup>
|
||||||
182
packages/partner/pages/chooseDevice/chooseDevice.js
Normal file
182
packages/partner/pages/chooseDevice/chooseDevice.js
Normal file
@ -0,0 +1,182 @@
|
|||||||
|
let util = require('../../../../utils/util')
|
||||||
|
let apiArr = require('../../../../api/partner')
|
||||||
|
// packages/partner/pages/chooseDevice/chooseDevice.js
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
deviceCode: "",
|
||||||
|
deviceInfo: "",
|
||||||
|
deviceList: [],
|
||||||
|
flag: false,
|
||||||
|
page_num: 1,
|
||||||
|
page_size: 10,
|
||||||
|
id: "",
|
||||||
|
product_id:""
|
||||||
|
},
|
||||||
|
scanQrcode() {
|
||||||
|
let that = this
|
||||||
|
wx.scanCode({
|
||||||
|
success: (res) => {
|
||||||
|
// 处理扫码结果
|
||||||
|
this.setData({
|
||||||
|
deviceCode: res.result
|
||||||
|
});
|
||||||
|
util.postUrl4(apiArr.ScanQrcodeInNewOrder, {
|
||||||
|
device_code: res.result,
|
||||||
|
install_id: that.data.id
|
||||||
|
}, res => {
|
||||||
|
that.setData({
|
||||||
|
deviceInfo: res
|
||||||
|
})
|
||||||
|
|
||||||
|
const pages = getCurrentPages();
|
||||||
|
const prevPage = pages[pages.length - 2]; // 获取上一页实例
|
||||||
|
// 传值给上一页
|
||||||
|
prevPage.setData({
|
||||||
|
deviceInfo: res // 可以是对象、数组等
|
||||||
|
});
|
||||||
|
// 调用上一页的方法
|
||||||
|
// prevPage.yourRefreshMethod(); // 你定义的刷新方法
|
||||||
|
// 返回上一页
|
||||||
|
wx.navigateBack();
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
wx.showToast({
|
||||||
|
title: '扫码失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getDeviceList() {
|
||||||
|
wx.showLoading({
|
||||||
|
title: '加载中',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
let that = this
|
||||||
|
let admin = wx.getStorageSync('admin')
|
||||||
|
let param = {
|
||||||
|
page_size: that.data.page_size,
|
||||||
|
page_num: that.data.page_num,
|
||||||
|
search: that.data.searchText,
|
||||||
|
dealer_id: admin.shop_id,
|
||||||
|
status: Number(9),
|
||||||
|
product_id:that.data.product_id
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
util.postUrl4(apiArr.deviceList, param, res => {
|
||||||
|
wx.hideLoading()
|
||||||
|
let flag = false
|
||||||
|
if (res.list && res.list.length == that.data.page_size) {
|
||||||
|
console.log(123);
|
||||||
|
flag = true
|
||||||
|
} else {
|
||||||
|
console.log(456);
|
||||||
|
flag = false
|
||||||
|
}
|
||||||
|
that.setData({
|
||||||
|
deviceList: that.data.deviceList.concat(res.list || []),
|
||||||
|
total: res.total,
|
||||||
|
flag,
|
||||||
|
page_num: that.data.page_num + 1
|
||||||
|
})
|
||||||
|
console.log(that.data.flag);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
deviceDesc(e) {
|
||||||
|
const pages = getCurrentPages();
|
||||||
|
const prevPage = pages[pages.length - 2]; // 获取上一页实例
|
||||||
|
// 传值给上一页
|
||||||
|
prevPage.setData({
|
||||||
|
deviceInfo: e.currentTarget.dataset.item // 可以是对象、数组等
|
||||||
|
});
|
||||||
|
// 调用上一页的方法
|
||||||
|
// prevPage.yourRefreshMethod(); // 你定义的刷新方法
|
||||||
|
// 返回上一页
|
||||||
|
wx.navigateBack();
|
||||||
|
},
|
||||||
|
ipt1(e) {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
searchText: e.detail.value,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
search2() {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
deviceList: [],
|
||||||
|
flag: false,
|
||||||
|
page_num: 1
|
||||||
|
})
|
||||||
|
that.getDeviceList()
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
id: options.id,
|
||||||
|
product_id:options.product_id
|
||||||
|
})
|
||||||
|
that.getDeviceList()
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
let that = this
|
||||||
|
if (that.data.flag) {
|
||||||
|
that.getDeviceList()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
4
packages/partner/pages/chooseDevice/chooseDevice.json
Normal file
4
packages/partner/pages/chooseDevice/chooseDevice.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {},
|
||||||
|
"navigationBarTitleText": "选择设备"
|
||||||
|
}
|
||||||
49
packages/partner/pages/chooseDevice/chooseDevice.wxml
Normal file
49
packages/partner/pages/chooseDevice/chooseDevice.wxml
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
<view class="container">
|
||||||
|
<view class="upkeep_select">
|
||||||
|
<view class="ipt">
|
||||||
|
|
||||||
|
<input value="{{searchText}}" bindinput="ipt1" type="text" placeholder="请输入设备编码" placeholder-style="color: #999999;font-size: 26rpx;" />
|
||||||
|
<view class="searchBox" bind:tap="search2">
|
||||||
|
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/dervice/deriveSearch.png?1?1" mode="widthFix" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<van-icon bind:tap="scanQrcode" name="scan" size="28" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="deviceItem" wx:if="{{deviceList.length != 0}}" wx:for="{{deviceList}}" bind:tap="deviceDesc" data-item="{{item}}">
|
||||||
|
<view class="deviceItem_Tit">设备编码:{{item.device_code}}</view>
|
||||||
|
|
||||||
|
<view class="deviceItemCon">
|
||||||
|
<view class="deviceItemCon_tit">产品名称</view>
|
||||||
|
<view class="deviceItemCon_con">{{item.product_name}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="deviceItemCon">
|
||||||
|
<view class="deviceItemCon_tit">经销商</view>
|
||||||
|
<view class="deviceItemCon_con">{{item.dealer_name}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="deviceItemCon">
|
||||||
|
<view class="deviceItemCon_tit">经销商编码</view>
|
||||||
|
<view class="deviceItemCon_con">{{item.dealer_code}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="deviceItemCon">
|
||||||
|
<view class="deviceItemCon_tit">网络状态</view>
|
||||||
|
<view class="deviceItemCon_con">{{item.network_status == '1'?'正常':'离线'}}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="deviceItemCon">
|
||||||
|
<view class="deviceItemCon_tit">安装状态</view>
|
||||||
|
<view class="deviceItemCon_con" wx:if="{{item.install_status == 1}}">已安装</view>
|
||||||
|
<view class="deviceItemCon_con" wx:if="{{item.install_status == 2}}">空闲</view>
|
||||||
|
<view class="deviceItemCon_con" wx:if="{{item.install_status == 3}}">已拆机</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="deviceItemCon">
|
||||||
|
<view class="deviceItemCon_tit">设备地址</view>
|
||||||
|
<view class="deviceItemCon_con">{{item.address}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view wx:if="{{deviceList.length == 0}}">
|
||||||
|
<van-empty description="暂无内容" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
84
packages/partner/pages/chooseDevice/chooseDevice.wxss
Normal file
84
packages/partner/pages/chooseDevice/chooseDevice.wxss
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
.upkeep_select {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #222222;
|
||||||
|
background-color: #F9F9F9;
|
||||||
|
padding: 20rpx 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.upkeep_select .ipt {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
background-color: #fff;
|
||||||
|
width: 710rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
background: #FFFFFF;
|
||||||
|
border-radius: 100rpx 100rpx 100rpx 100rpx;
|
||||||
|
padding-left: 26rpx;
|
||||||
|
padding-right: 26rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ipt input {
|
||||||
|
flex: 1;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ipt image {
|
||||||
|
width: 60rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
page {
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deviceItem {
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 30rpx 20rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deviceItem_Tit {
|
||||||
|
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #222222;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deviceItemCon {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deviceItemCon_tit {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #999999;
|
||||||
|
margin-right: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deviceItemCon_con {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #222222;
|
||||||
|
}
|
||||||
|
|
||||||
|
.searchBox {
|
||||||
|
padding-left: 30rpx;
|
||||||
|
padding-right: 30rpx;
|
||||||
|
height: 70rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.searchBox image {
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
}
|
||||||
149
packages/partner/pages/chooseRepairDevice/chooseRepairDevice.js
Normal file
149
packages/partner/pages/chooseRepairDevice/chooseRepairDevice.js
Normal file
@ -0,0 +1,149 @@
|
|||||||
|
let util = require('../../../../utils/util')
|
||||||
|
let apiArr = require('../../../../api/partner')
|
||||||
|
// packages/partner/pages/chooseDevice/chooseDevice.js
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
deviceCode: "",
|
||||||
|
deviceInfo: "",
|
||||||
|
deviceList: [],
|
||||||
|
flag: false,
|
||||||
|
page_num: 1,
|
||||||
|
page_size: 10,
|
||||||
|
},
|
||||||
|
scanQrcode() {
|
||||||
|
let that = this
|
||||||
|
wx.scanCode({
|
||||||
|
success: (res) => {
|
||||||
|
// 处理扫码结果
|
||||||
|
this.setData({
|
||||||
|
deviceCode: res.result
|
||||||
|
});
|
||||||
|
util.postUrl4(apiArr.getDeviceByCode, {
|
||||||
|
device_code: res.result,
|
||||||
|
install_id: that.data.id
|
||||||
|
}, res => {
|
||||||
|
that.setData({
|
||||||
|
deviceInfo: res
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
wx.showToast({
|
||||||
|
title: '扫码失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getDeviceList() {
|
||||||
|
wx.showLoading({
|
||||||
|
title: '加载中',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
let that = this
|
||||||
|
let admin = wx.getStorageSync('admin')
|
||||||
|
let param = {
|
||||||
|
page_size: that.data.page_size,
|
||||||
|
page_num: that.data.page_num,
|
||||||
|
search: that.data.searchText,
|
||||||
|
dealer_id: admin.shop_id,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
util.postUrl4(apiArr.deviceList, param, res => {
|
||||||
|
wx.hideLoading()
|
||||||
|
let flag = false
|
||||||
|
if (res.list && res.list.length == that.data.page_size) {
|
||||||
|
console.log(123);
|
||||||
|
flag = true
|
||||||
|
} else {
|
||||||
|
console.log(456);
|
||||||
|
flag = false
|
||||||
|
}
|
||||||
|
that.setData({
|
||||||
|
deviceList: that.data.deviceList.concat(res.list || []),
|
||||||
|
total: res.total,
|
||||||
|
flag,
|
||||||
|
page_num: that.data.page_num + 1
|
||||||
|
})
|
||||||
|
console.log(that.data.flag);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
deviceDesc(e) {
|
||||||
|
console.log(e);
|
||||||
|
const pages = getCurrentPages();
|
||||||
|
const prevPage = pages[pages.length - 2]; // 获取上一页实例
|
||||||
|
// 传值给上一页
|
||||||
|
prevPage.setData({
|
||||||
|
deviceInfo: e.currentTarget.dataset.item // 可以是对象、数组等
|
||||||
|
});
|
||||||
|
// 调用上一页的方法
|
||||||
|
// prevPage.yourRefreshMethod(); // 你定义的刷新方法
|
||||||
|
// 返回上一页
|
||||||
|
wx.navigateBack();
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
this.getDeviceList()
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
console.log(123);
|
||||||
|
let that = this
|
||||||
|
if(that.data.flag){
|
||||||
|
that.getDeviceList()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {},
|
||||||
|
"navigationBarTitleText": "选择设备"
|
||||||
|
}
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
<view class="container">
|
||||||
|
<view class="upkeep_select">
|
||||||
|
<view class="ipt" bind:tap="scanQrcode">
|
||||||
|
<input value="{{searchText}}" disabled type="text" placeholder="扫码选择主板" placeholder-style="color: #999999;font-size: 26rpx;" />
|
||||||
|
<van-icon name="scan" size="26" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="deviceItem" wx:if="{{deviceList.length != 0}}" wx:for="{{deviceList}}" bind:tap="deviceDesc" data-item="{{item}}">
|
||||||
|
<view class="deviceItem_Tit">设备编码:{{item.device_code}}</view>
|
||||||
|
|
||||||
|
<view class="deviceItemCon">
|
||||||
|
<view class="deviceItemCon_tit">产品名称</view>
|
||||||
|
<view class="deviceItemCon_con">{{item.product_name}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="deviceItemCon">
|
||||||
|
<view class="deviceItemCon_tit">经销商</view>
|
||||||
|
<view class="deviceItemCon_con">{{item.dealer_name}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="deviceItemCon">
|
||||||
|
<view class="deviceItemCon_tit">经销商编码</view>
|
||||||
|
<view class="deviceItemCon_con">{{item.dealer_code}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="deviceItemCon">
|
||||||
|
<view class="deviceItemCon_tit">网络状态</view>
|
||||||
|
<view class="deviceItemCon_con">{{item.network_status == '1'?'正常':'离线'}}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="deviceItemCon">
|
||||||
|
<view class="deviceItemCon_tit">安装状态</view>
|
||||||
|
<view class="deviceItemCon_con" wx:if="{{item.install_status == 1}}">已安装</view>
|
||||||
|
<view class="deviceItemCon_con" wx:if="{{item.install_status == 2}}">空闲</view>
|
||||||
|
<view class="deviceItemCon_con" wx:if="{{item.install_status == 3}}">已拆机</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="deviceItemCon">
|
||||||
|
<view class="deviceItemCon_tit">设备地址</view>
|
||||||
|
<view class="deviceItemCon_con">{{item.address}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view wx:if="{{deviceList.length == 0}}">
|
||||||
|
<van-empty description="暂无内容" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
@ -0,0 +1,68 @@
|
|||||||
|
.upkeep_select {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #222222;
|
||||||
|
background-color: #F9F9F9;
|
||||||
|
padding: 20rpx 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.upkeep_select .ipt {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
background-color: #fff;
|
||||||
|
width: 710rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
background: #FFFFFF;
|
||||||
|
border-radius: 100rpx 100rpx 100rpx 100rpx;
|
||||||
|
padding-left: 26rpx;
|
||||||
|
padding-right: 26rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ipt input {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ipt image {
|
||||||
|
width: 50rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
page{
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
}
|
||||||
|
.deviceItem {
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 30rpx 20rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deviceItem_Tit {
|
||||||
|
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #222222;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deviceItemCon {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deviceItemCon_tit {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #999999;
|
||||||
|
margin-right: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deviceItemCon_con {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #222222;
|
||||||
|
}
|
||||||
@ -169,7 +169,6 @@ Page({
|
|||||||
|
|
||||||
AreaConfirm(e){
|
AreaConfirm(e){
|
||||||
let that = this
|
let that = this
|
||||||
console.log(e);
|
|
||||||
let region
|
let region
|
||||||
if(e.detail.values[0].name == e.detail.values[1].name){
|
if(e.detail.values[0].name == e.detail.values[1].name){
|
||||||
region = e.detail.values[0].name + e.detail.values[2].name
|
region = e.detail.values[0].name + e.detail.values[2].name
|
||||||
|
|||||||
@ -44,6 +44,7 @@
|
|||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #222222;
|
color: #222222;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.masterItem_msg_tit view {
|
.masterItem_msg_tit view {
|
||||||
|
|||||||
302
packages/partner/pages/device/device.js
Normal file
302
packages/partner/pages/device/device.js
Normal file
@ -0,0 +1,302 @@
|
|||||||
|
let util = require('../../../../utils/util')
|
||||||
|
const apiArr = require('../../../../api/water_filter')
|
||||||
|
const apiArr2 = require('../../../../api/partner')
|
||||||
|
const app = getApp({ allowDefault: true })
|
||||||
|
|
||||||
|
// packages/WaterPurifier/pages/device/deviceList/deviceList.js
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
s: app.system.statusBarHeight, // 状态栏高度
|
||||||
|
n: (app.menu.top - app.system.statusBarHeight) * 2 + app.menu.height, // 导航栏高度
|
||||||
|
t: app.menu.top, // 胶囊局顶部距离
|
||||||
|
h: app.menu.height, // 胶囊高度
|
||||||
|
|
||||||
|
option1: [
|
||||||
|
{ text: '全部', value: 0 },
|
||||||
|
{ text: '已安装', value: 1 },
|
||||||
|
{ text: '空闲', value: 2 },
|
||||||
|
{ text: '已拆机', value: 3 },
|
||||||
|
],
|
||||||
|
option2: [
|
||||||
|
{ text: '全部', value: 0 },
|
||||||
|
{ text: '在用', value: 1 },
|
||||||
|
{ text: '待启用', value: 2 },
|
||||||
|
{ text: '关机', value: 3 },
|
||||||
|
{ text: '已拆机', value: 4 },
|
||||||
|
{ text: '漏水', value: 5 },
|
||||||
|
{ text: '制水故障', value: 6 },
|
||||||
|
{ text: '报废', value: 7 },
|
||||||
|
{ text: '已欠费', value: 8 },
|
||||||
|
{ text: '在库', value: 9 },
|
||||||
|
{ text: '激活失败', value: 10 },
|
||||||
|
],
|
||||||
|
stateType: {
|
||||||
|
1: '在用',
|
||||||
|
2: '待启用',
|
||||||
|
3: '关机',
|
||||||
|
4: '已拆机',
|
||||||
|
5: '漏水',
|
||||||
|
6: '制水故障',
|
||||||
|
7: '报废',
|
||||||
|
8: '已欠费',
|
||||||
|
9: '在库',
|
||||||
|
10: '激活失败'
|
||||||
|
},
|
||||||
|
value1: 0,
|
||||||
|
value2: 0,
|
||||||
|
nav_list: {},
|
||||||
|
foot_width: "",
|
||||||
|
|
||||||
|
searchText: "",//搜索文字
|
||||||
|
page_num: 1,
|
||||||
|
page_size: 10,
|
||||||
|
flag: false,
|
||||||
|
total: '',
|
||||||
|
deviceList: [],
|
||||||
|
dropdownOpen: false,
|
||||||
|
text1:'安装状态:全部',
|
||||||
|
text2:"设备状态:全部"
|
||||||
|
|
||||||
|
},
|
||||||
|
back(){
|
||||||
|
wx.reLaunch({
|
||||||
|
url: '/packages/partner/pages/mine/mine',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onDropdownOpen() {
|
||||||
|
console.log(123);
|
||||||
|
this.setData({ dropdownOpen: true });
|
||||||
|
},
|
||||||
|
onDropdownClose() {
|
||||||
|
this.setData({ dropdownOpen: false });
|
||||||
|
},
|
||||||
|
ipt1(e) {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
searchText: e.detail.value,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
deviceDesc(e) {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: `../deviceDesc/deviceDesc?device_id=${e.currentTarget.dataset.device_id}`,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
addWorkOrders() {
|
||||||
|
console.log(123123);
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/packages/partner/pages/newWorkOrder/newWorkOrder',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//安装状态
|
||||||
|
headerNetWorkClick(e) {
|
||||||
|
let that = this
|
||||||
|
let text1 = ''
|
||||||
|
if(e.detail == 0){
|
||||||
|
text1 = '安装状态:全部'
|
||||||
|
}else if(e.detail == 1){
|
||||||
|
text1 = '安装状态:已安装'
|
||||||
|
}else if(e.detail == 2){
|
||||||
|
text1 = '安装状态:空闲'
|
||||||
|
}else if(e.detail == 3){
|
||||||
|
text1 = '安装状态:已拆机'
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setData({
|
||||||
|
value1: e.detail,
|
||||||
|
page_num: 1,
|
||||||
|
deviceList: [],
|
||||||
|
text1
|
||||||
|
});
|
||||||
|
if (e.detail == 0) {
|
||||||
|
this.getDeviceList(0,that.data.value2);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.getDeviceList(e.detail, that.data.value2);
|
||||||
|
},
|
||||||
|
|
||||||
|
// 设备状态
|
||||||
|
headerEquipmentClick(e) {
|
||||||
|
let that = this
|
||||||
|
let text2 = ''
|
||||||
|
if(e.detail == 0){
|
||||||
|
text2 = '设备状态:全部'
|
||||||
|
}else if(e.detail == 1){
|
||||||
|
text2 = '设备状态:在用'
|
||||||
|
}else if(e.detail == 2){
|
||||||
|
text2 = '设备状态:待启用'
|
||||||
|
}else if(e.detail == 3){
|
||||||
|
text2 = '设备状态:关机'
|
||||||
|
}else if(e.detail == 4){
|
||||||
|
text2 = '设备状态:已拆机'
|
||||||
|
}else if(e.detail == 5){
|
||||||
|
text2 = '设备状态:漏水'
|
||||||
|
}else if(e.detail == 6){
|
||||||
|
text2 = '设备状态:制水故障'
|
||||||
|
}else if(e.detail == 7){
|
||||||
|
text2 = '设备状态:报废'
|
||||||
|
}else if(e.detail == 8){
|
||||||
|
text2 = '设备状态:已欠费'
|
||||||
|
}else if(e.detail == 9){
|
||||||
|
text2 = '设备状态:在库'
|
||||||
|
}else if(e.detail == 10){
|
||||||
|
text2 = '设备状态:激活失败'
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
value2: e.detail,
|
||||||
|
page_num: 1,
|
||||||
|
deviceList: [],
|
||||||
|
text2
|
||||||
|
});
|
||||||
|
if (e.detail == 0) {
|
||||||
|
this.getDeviceList(that.data.value1,0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.getDeviceList(that.data.value1, e.detail);
|
||||||
|
},
|
||||||
|
|
||||||
|
search2() {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
deviceList: [],
|
||||||
|
flag: false,
|
||||||
|
page_num: 1
|
||||||
|
})
|
||||||
|
that.getDeviceList('', '')
|
||||||
|
},
|
||||||
|
getDeviceList(networkStatus, status) {
|
||||||
|
wx.showLoading({
|
||||||
|
title: '加载中',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
let that = this
|
||||||
|
let admin = wx.getStorageSync('admin')
|
||||||
|
let param = {
|
||||||
|
page_size: that.data.page_size,
|
||||||
|
page_num: that.data.page_num,
|
||||||
|
search: that.data.searchText,
|
||||||
|
dealer_id: admin.shop_id
|
||||||
|
};
|
||||||
|
// if (networkStatus) {
|
||||||
|
// param = {
|
||||||
|
// ...param,
|
||||||
|
// install_status: networkStatus
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// if (status) {
|
||||||
|
// }
|
||||||
|
param = {
|
||||||
|
...param,
|
||||||
|
status: Number(status),
|
||||||
|
install_status: networkStatus
|
||||||
|
}
|
||||||
|
|
||||||
|
util.postUrl4(apiArr2.deviceList, param, res => {
|
||||||
|
wx.hideLoading()
|
||||||
|
let flag = false
|
||||||
|
if (res.list && res.list.length == that.data.page_size) {
|
||||||
|
console.log(123);
|
||||||
|
flag = true
|
||||||
|
} else {
|
||||||
|
console.log(456);
|
||||||
|
flag = false
|
||||||
|
}
|
||||||
|
that.setData({
|
||||||
|
deviceList: that.data.deviceList.concat(res.list || []),
|
||||||
|
total: res.total,
|
||||||
|
flag,
|
||||||
|
page_num: that.data.page_num + 1
|
||||||
|
})
|
||||||
|
console.log(that.data.flag);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
this.getDeviceList();
|
||||||
|
wx.showShareMenu({
|
||||||
|
withShareTicket: true,
|
||||||
|
menus: ['shareAppMessage', 'shareTimeline']
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
flag: false,
|
||||||
|
page_num: 1,
|
||||||
|
total: 0,
|
||||||
|
searchText: "",
|
||||||
|
value1: "",
|
||||||
|
value2: "",
|
||||||
|
deviceList: []
|
||||||
|
})
|
||||||
|
that.getDeviceList();
|
||||||
|
wx.stopPullDownRefresh();
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
let that = this
|
||||||
|
if (that.data.flag) {
|
||||||
|
that.getDeviceList('', that.data.value2)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
return {
|
||||||
|
title: '人人爱净水', // 分享卡片标题(必填)
|
||||||
|
path: '/pages/water_filter/water_filter', // 用户点击后跳转的路径(可选,默认当前页)
|
||||||
|
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义图片(可选,比例建议 5:4)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onShareTimeline() {
|
||||||
|
return {
|
||||||
|
title: '人人爱净水', // 自定义标题
|
||||||
|
query: '', // 自定义页面路径中的参数
|
||||||
|
imageUrl: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/share.png' // 自定义分享图片路径
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
6
packages/partner/pages/device/device.json
Normal file
6
packages/partner/pages/device/device.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {},
|
||||||
|
"enablePullDownRefresh": true,
|
||||||
|
"navigationBarTitleText": "设备管理",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
84
packages/partner/pages/device/device.wxml
Normal file
84
packages/partner/pages/device/device.wxml
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
<view class="nav-box" style="padding-top: {{ t }}px;;">
|
||||||
|
<view class="nav-bar" style="height: {{ h }}px;">
|
||||||
|
<view class="nav-bar-left" bind:tap="back">
|
||||||
|
<van-icon name="arrow-left" size="24px" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="nav-bar-title" style="height: {{ h }}px;line-height: {{ h }}px;color: {{color}};font-size: 28rpx;">
|
||||||
|
工单详情
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="nav-bar-right">
|
||||||
|
<van-icon name="arrow-left" size="24px" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<view class="deviceList" class="page-container {{ dropdownOpen ? 'fixed-page' : '' }}">
|
||||||
|
<view class="white">
|
||||||
|
<view class="deviceImg">
|
||||||
|
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/dervice/deviceList.png?1" mode="widthFix" />
|
||||||
|
</view>
|
||||||
|
<view class="deviceText">设备总数:{{total}}</view>
|
||||||
|
<view class="deviceIpt">
|
||||||
|
<input type="text" confirm-type="search" bindconfirm="search2" value="{{searchText}}" bindinput="ipt1" placeholder="设备编号/客户名称/客户手机/客户地址" placeholder-style="color: #999999;font-size: 28rpx;" />
|
||||||
|
|
||||||
|
<view class="searchBox" bind:tap="search2">
|
||||||
|
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/dervice/deriveSearch.png?1?1" mode="widthFix" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="dropBox">
|
||||||
|
<van-dropdown-menu>
|
||||||
|
<van-dropdown-item bind:open="onDropdownOpen" bind:close="onDropdownClose" title="{{text1}}" value="{{ value1 }}" options="{{ option1 }}" bind:change="headerNetWorkClick" />
|
||||||
|
<van-dropdown-item bind:open="onDropdownOpen" bind:close="onDropdownClose" title="{{text2}}" value="{{ value2 }}" options="{{ option2 }}" bind:change="headerEquipmentClick" />
|
||||||
|
</van-dropdown-menu>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="deviceItem_box">
|
||||||
|
<view class="deviceItem" wx:if="{{deviceList.length != 0}}" wx:for="{{deviceList}}" data-state="{{item.install_status}}" bind:tap="deviceDesc" data-device_id="{{item.device_id}}">
|
||||||
|
<view class="deviceItem_Tit">设备编码:{{item.device_code}}</view>
|
||||||
|
<view class="deviceItemCon">
|
||||||
|
<view class="deviceItemCon_tit">客户姓名</view>
|
||||||
|
<view class="deviceItemCon_con">{{item.customer_info.name}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="deviceItemCon">
|
||||||
|
<view class="deviceItemCon_tit">客户手机</view>
|
||||||
|
<view class="deviceItemCon_con">{{item.customer_info.phone}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="deviceItemCon">
|
||||||
|
<view class="deviceItemCon_tit">网络状态</view>
|
||||||
|
<view class="deviceItemCon_con">{{item.network_status == '1'?'正常':'离线'}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="deviceItemCon">
|
||||||
|
<view class="deviceItemCon_tit">设备状态</view>
|
||||||
|
<view class="deviceItemCon_con">{{stateType[item.status]}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="deviceItemCon">
|
||||||
|
<view class="deviceItemCon_tit">安装状态</view>
|
||||||
|
<view class="deviceItemCon_con" wx:if="{{item.install_status == 1}}">已安装</view>
|
||||||
|
<view class="deviceItemCon_con" wx:if="{{item.install_status == 2}}">空闲</view>
|
||||||
|
<view class="deviceItemCon_con" wx:if="{{item.install_status == 3}}">已拆机</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="deviceItemCon">
|
||||||
|
<view class="deviceItemCon_tit">设备地址</view>
|
||||||
|
<view class="deviceItemCon_con">{{item.region}}{{item.address}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view wx:if="{{deviceList.length == 0}}">
|
||||||
|
<van-empty description="暂无内容" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<view class="addBtn" bind:tap="addWorkOrders">新增</view>
|
||||||
|
|
||||||
|
<cover-view style="position: fixed;">
|
||||||
|
<import src="/pages/public/footer.wxml" />
|
||||||
|
<template is="footer-nav" data="{{nav_list:nav_list,foot_width:foot_width}}" />
|
||||||
|
</cover-view>
|
||||||
152
packages/partner/pages/device/device.wxss
Normal file
152
packages/partner/pages/device/device.wxss
Normal file
@ -0,0 +1,152 @@
|
|||||||
|
.nav-box {
|
||||||
|
padding-bottom: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-bar-right {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deviceList {
|
||||||
|
background-color: #F9F9F9;
|
||||||
|
padding-bottom: 120rpx;
|
||||||
|
min-height: 95vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.white {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fixed-page {
|
||||||
|
position: fixed;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deviceImg {
|
||||||
|
width: 157rpx;
|
||||||
|
height: 157rpx;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 52rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deviceImg image {
|
||||||
|
width: 100% !important;
|
||||||
|
height: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deviceText {
|
||||||
|
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #222222;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 3rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deviceIpt {
|
||||||
|
width: 710rpx;
|
||||||
|
height: 98rpx;
|
||||||
|
background: #F9F9F9;
|
||||||
|
border-radius: 100rpx 100rpx 100rpx 100rpx;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding-left: 26rpx;
|
||||||
|
padding-right: 26rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deviceIpt input {
|
||||||
|
height: 100%;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deviceIpt image {
|
||||||
|
width: 42rpx;
|
||||||
|
height: 42rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropBox .van-dropdown-menu {
|
||||||
|
box-shadow: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropBox .van-ellipsis {
|
||||||
|
font-size: 26rpx !important;
|
||||||
|
color: #999999 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deviceItem {
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 30rpx 20rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deviceItem_Tit {
|
||||||
|
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #222222;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deviceItemCon {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deviceItemCon_tit {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #999999;
|
||||||
|
margin-right: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deviceItemCon_con {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #222222;
|
||||||
|
}
|
||||||
|
|
||||||
|
.searchBox {
|
||||||
|
padding-left: 30rpx;
|
||||||
|
height: 54rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.addBtn {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
width: 100rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
background: #2583FF;
|
||||||
|
position: fixed;
|
||||||
|
right: 55rpx;
|
||||||
|
bottom: 200rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.addBtn::after {
|
||||||
|
content: '';
|
||||||
|
background: rgba(77, 154, 255, .5);
|
||||||
|
filter: blur(10.899999618530273rpx);
|
||||||
|
width: 90rpx;
|
||||||
|
height: 90rpx;
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
top: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
border-radius: 50%;
|
||||||
|
overflow: hidden;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
798
packages/partner/pages/deviceDesc/deviceDesc.js
Normal file
798
packages/partner/pages/deviceDesc/deviceDesc.js
Normal file
@ -0,0 +1,798 @@
|
|||||||
|
|
||||||
|
let util = require('../../../../utils/util')
|
||||||
|
const apiArr = require('../../../../api/water_filter')
|
||||||
|
const apiArr2 = require('../../../../api/partner')
|
||||||
|
|
||||||
|
|
||||||
|
// packages/master/deviceInfo/index.js
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
id: "",
|
||||||
|
currentDevice: "",
|
||||||
|
imagePath: "",
|
||||||
|
ec: {
|
||||||
|
onInit: initChart
|
||||||
|
},
|
||||||
|
|
||||||
|
appointment_time: "",
|
||||||
|
show: false,
|
||||||
|
show2: false,
|
||||||
|
show3: false,
|
||||||
|
show4: false,
|
||||||
|
show5: false,
|
||||||
|
show6: false,
|
||||||
|
remarks1: "", //拆机备注
|
||||||
|
remainingDays: "",//到期日期
|
||||||
|
surplusFlow: "",//剩余流量
|
||||||
|
remaining_days: "",//转时长
|
||||||
|
surplus_flow: "",//转流量
|
||||||
|
minDate: new Date().getTime(),
|
||||||
|
formatter(type, value) {
|
||||||
|
if (type === 'year') {
|
||||||
|
return `${value}年`;
|
||||||
|
}
|
||||||
|
if (type === 'month') {
|
||||||
|
return `${value}月`;
|
||||||
|
}
|
||||||
|
if (type === 'day') {
|
||||||
|
return `${value}日`;
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
},
|
||||||
|
UninstallDateShow:false,
|
||||||
|
uninstall_time:"",
|
||||||
|
},
|
||||||
|
onInput(event) {
|
||||||
|
let that = this
|
||||||
|
const date = new Date(event.detail); // 获取选中的 Date 对象
|
||||||
|
const year = date.getFullYear(); // 获取年份
|
||||||
|
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,所以需要+1
|
||||||
|
const day = String(date.getDate()).padStart(2, '0');
|
||||||
|
const hours = String(date.getHours()).padStart(2, '0'); // 小时补零
|
||||||
|
const minutes = String(date.getMinutes()).padStart(2, '0'); // 分钟补零
|
||||||
|
const time = `${year}-${month}-${day} ${hours}:${minutes}`;
|
||||||
|
that.setData({
|
||||||
|
appointment_time: time,
|
||||||
|
show: false
|
||||||
|
})
|
||||||
|
|
||||||
|
that.cancelActivation()
|
||||||
|
},
|
||||||
|
onClose() {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
show: false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
formatPercentage(value) {
|
||||||
|
return Math.max(0, Number((value || 0).toFixed(0)));
|
||||||
|
},
|
||||||
|
getInfo() {
|
||||||
|
let that = this
|
||||||
|
console.log(that, 'ssss');
|
||||||
|
util.postUrl4(apiArr.deviceDesc, {
|
||||||
|
device_id: that.data.id
|
||||||
|
}, res => {
|
||||||
|
res.remainDay = Math.max(0, that.getDaysBetweenDates2(res.expiration_duration)) //剩余天数
|
||||||
|
if (res.expiration_duration) {
|
||||||
|
res.difDay = Math.max(0, that.getDaysBetweenDates(res.install_time)) //服务天数,确保不小于0
|
||||||
|
} else {
|
||||||
|
const installDate = new Date(res.install_time)
|
||||||
|
const expireDate = new Date(res.expiration_duration)
|
||||||
|
res.difDay = Math.max(0, Math.floor((expireDate - installDate) / (1000 * 60 * 60 * 24))) //确保不小于0
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res.parts) {
|
||||||
|
res.parts.forEach(item => {
|
||||||
|
item.difDay = that.getDaysBetweenDates(item.start_time)
|
||||||
|
const remainingDays = Math.max(0, (item.available_days || 0) - (item.difDay || 0));
|
||||||
|
|
||||||
|
item.percentageDay = that.formatPercentage(
|
||||||
|
(remainingDays / (item.available_days || 1)) * 100
|
||||||
|
);
|
||||||
|
item.percentageCapacity = that.formatPercentage(
|
||||||
|
(1 - (item.threshold_volume || 0) / (item.available_volume || 1)) * 100
|
||||||
|
);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
res.today = Number(res.today).toFixed(2)
|
||||||
|
res.yesterday = Number(res.yesterday).toFixed(2)
|
||||||
|
|
||||||
|
that.setData({
|
||||||
|
currentDevice: res
|
||||||
|
})
|
||||||
|
let Xarr = [];
|
||||||
|
let Yarr = [];
|
||||||
|
res.device_net.forEach(item => {
|
||||||
|
Xarr.push(item.create_time.slice(11, 16))
|
||||||
|
Yarr.push((item.cumulative_filtration_flow).toFixed(1))
|
||||||
|
})
|
||||||
|
that.updateChart({
|
||||||
|
xAxis: Xarr,
|
||||||
|
series: Yarr
|
||||||
|
})
|
||||||
|
that.getDeriveInfo()
|
||||||
|
setTimeout(() => {
|
||||||
|
const ecComponent = that.selectComponent("#mychart-dom-bar")
|
||||||
|
// 将 canvas 内容转换为临时图片文件
|
||||||
|
ecComponent.canvasToTempFilePath({
|
||||||
|
// canvasId: 'mychart-dom-bar',
|
||||||
|
success: (result) => {
|
||||||
|
that.base64({
|
||||||
|
url: result.tempFilePath,
|
||||||
|
type: 'png',
|
||||||
|
}).then((res) => {
|
||||||
|
that.setData({
|
||||||
|
imagePath: res
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.error('转换失败:', err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, 2000)
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
replay(e) {
|
||||||
|
wx.showLoading({
|
||||||
|
title: '重置中...',
|
||||||
|
})
|
||||||
|
util.postUrl4(apiArr.resetFilter, {
|
||||||
|
part_id: e.currentTarget.dataset.item.id,
|
||||||
|
device_id: e.currentTarget.dataset.item.device_id,
|
||||||
|
}, res => {
|
||||||
|
wx.hideLoading()
|
||||||
|
console.log(res);
|
||||||
|
if (res.msg == '操作成功') {
|
||||||
|
wx.showToast({
|
||||||
|
title: '重置成功!',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
that.getfilterList()
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
//查询设备实时信息
|
||||||
|
getDeriveInfo() {
|
||||||
|
let that = this
|
||||||
|
util.postUrl4(apiArr.boardInfo, {
|
||||||
|
device_id: that.data.currentDevice.device_id
|
||||||
|
}, res => {
|
||||||
|
console.log(res);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
///////////////////////////////////////////////新增/////////////////////////////////////////////////////////////////////////
|
||||||
|
onClose2() {
|
||||||
|
this.setData({
|
||||||
|
show2: false,
|
||||||
|
show3: false,
|
||||||
|
show4: false,
|
||||||
|
show5: false,
|
||||||
|
show6: false,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 拆机
|
||||||
|
uninstall() {
|
||||||
|
let that = this
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '请确保设备通电开机状态,该操作将取消设备激活状态',
|
||||||
|
complete: (res) => {
|
||||||
|
if (res.cancel) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res.confirm) {
|
||||||
|
that.setData({
|
||||||
|
show2: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
remarksIpt1(e) {
|
||||||
|
console.log(e);
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
remarks1: e.detail.value
|
||||||
|
})
|
||||||
|
},
|
||||||
|
createUninstall() {
|
||||||
|
wx.showLoading({
|
||||||
|
title: '加载中...',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
let that = this
|
||||||
|
util.postUrl4(apiArr.UninstallOrder, {
|
||||||
|
device_id: that.data.currentDevice.device_id,
|
||||||
|
remark: that.data.remarks1,
|
||||||
|
appointment_time:that.data.uninstall_time + ":00"
|
||||||
|
}, res => {
|
||||||
|
wx.hideLoading()
|
||||||
|
wx.showToast({
|
||||||
|
title: '拆机工单创建完成',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/packages/partner/pages/removeOrder/removeOrder',
|
||||||
|
})
|
||||||
|
}, 1500)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeUninstallDate(){
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
UninstallDateShow:true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
closeUninstallDate(){
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
UninstallDateShow:false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onInput2(event){
|
||||||
|
let that = this
|
||||||
|
const date = new Date(event.detail); // 获取选中的 Date 对象
|
||||||
|
const year = date.getFullYear(); // 获取年份
|
||||||
|
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,所以需要+1
|
||||||
|
const day = String(date.getDate()).padStart(2, '0');
|
||||||
|
const hours = String(date.getHours()).padStart(2, '0'); // 小时补零
|
||||||
|
const minutes = String(date.getMinutes()).padStart(2, '0'); // 分钟补零
|
||||||
|
const time = `${year}-${month}-${day} ${hours}:${minutes}`;
|
||||||
|
that.setData({
|
||||||
|
uninstall_time:time,
|
||||||
|
UninstallDateShow:false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 激活
|
||||||
|
active() {
|
||||||
|
wx.showLoading({
|
||||||
|
title: '加载中...',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
let that = this
|
||||||
|
util.postUrl4(apiArr.deviceActive, {
|
||||||
|
device_id: that.data.currentDevice.device_id
|
||||||
|
}, res => {
|
||||||
|
console.log(res);
|
||||||
|
wx.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
that.getInfo()
|
||||||
|
wx.hideLoading()
|
||||||
|
|
||||||
|
return
|
||||||
|
if (res.statusCode == 200) {
|
||||||
|
wx.showToast({
|
||||||
|
title: '激活成功',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
that.getInfo()
|
||||||
|
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: res.data.msg,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
wx.hideLoading()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
isPureNumber(value) {
|
||||||
|
return /^\d+(\.\d+)?$/.test(value);
|
||||||
|
},
|
||||||
|
//时长充值
|
||||||
|
recharge1() {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
show4: true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
deviceDeactivation() {
|
||||||
|
let that = this
|
||||||
|
if (!that.isPureNumber(that.data.remainingDays)) {
|
||||||
|
return wx.showToast({
|
||||||
|
title: '请输入正确到期日期',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '确定要充值时长吗?请在设备通电开机的状态下进行操作',
|
||||||
|
complete: (res) => {
|
||||||
|
if (res.cancel) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res.confirm) {
|
||||||
|
wx.showLoading({
|
||||||
|
title: '加载中...',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
util.postUrl4(apiArr.deviceDeactivation, {
|
||||||
|
device_id: that.data.currentDevice.device_id,
|
||||||
|
remainingDays: that.data.remainingDays
|
||||||
|
}, res => {
|
||||||
|
wx.hideLoading()
|
||||||
|
if (res.data.code == 200) {
|
||||||
|
wx.showToast({
|
||||||
|
title: '充值成功',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
that.getInfo()
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: res.data.msg,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
that.setData({
|
||||||
|
show4: false,
|
||||||
|
remainingDays: ""
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeRemainingDay(e) {
|
||||||
|
console.log(e);
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
remainingDays: e.detail.value
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//流量充值
|
||||||
|
recharge2() {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
show3: true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeSurplusFlow(e) {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
surplusFlow: e.detail.value
|
||||||
|
})
|
||||||
|
},
|
||||||
|
deviceDataForce() {
|
||||||
|
let that = this
|
||||||
|
if (!that.isPureNumber(that.data.surplusFlow)) {
|
||||||
|
return wx.showToast({
|
||||||
|
title: '请输入正确数额',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '确定要充值流量吗?请在设备通电开机的状态下进行操作',
|
||||||
|
complete: (res) => {
|
||||||
|
if (res.cancel) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res.confirm) {
|
||||||
|
util.postUrl4(apiArr.deviceDataForce, {
|
||||||
|
device_id: that.data.currentDevice.device_id,
|
||||||
|
surplusFlow: that.data.surplusFlow
|
||||||
|
}, res => {
|
||||||
|
if (res.data.code == 200) {
|
||||||
|
wx.showToast({
|
||||||
|
title: '充值成功',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
that.getInfo()
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: res.data.msg,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
that.setData({
|
||||||
|
show3: false,
|
||||||
|
surplusFlow: ""
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//转时长
|
||||||
|
timeSet() {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
show5: true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeRemainingDay2(e) {
|
||||||
|
console.log(e);
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
remaining_days: e.detail.value
|
||||||
|
})
|
||||||
|
},
|
||||||
|
modeToTime() {
|
||||||
|
let that = this
|
||||||
|
if (!that.data.remaining_days) {
|
||||||
|
return wx.showToast({
|
||||||
|
title: '请输入到期日期',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '确定要将设备转时长吗?请在设备通电开机的状态下进行操作',
|
||||||
|
complete: (res) => {
|
||||||
|
if (res.cancel) {
|
||||||
|
}
|
||||||
|
if (res.confirm) {
|
||||||
|
util.postUrl4(apiArr.deviceToTime, {
|
||||||
|
device_id: that.data.currentDevice.device_id,
|
||||||
|
remaining_days: that.data.remaining_days
|
||||||
|
}, res => {
|
||||||
|
if (res.data.code == 200) {
|
||||||
|
wx.showToast({
|
||||||
|
title: '充值成功',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
that.getInfo()
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: res.data.msg,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
that.setData({
|
||||||
|
show5: false,
|
||||||
|
remaining_days: ""
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 转流量
|
||||||
|
timeSet2() {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
show6: true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeRemainingDay3(e) {
|
||||||
|
console.log(e);
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
surplus_flow: e.detail.value
|
||||||
|
})
|
||||||
|
},
|
||||||
|
modeToFlowRate() {
|
||||||
|
let that = this
|
||||||
|
if (!that.data.surplus_flow) {
|
||||||
|
return wx.showToast({
|
||||||
|
title: '请输入数额',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '确定要设备转流量吗?请在设备通电开机的状态下进行操作',
|
||||||
|
complete: (res) => {
|
||||||
|
if (res.cancel) {
|
||||||
|
}
|
||||||
|
if (res.confirm) {
|
||||||
|
util.postUrl4(apiArr.deviceToTraffic, {
|
||||||
|
device_id: that.data.currentDevice.device_id,
|
||||||
|
surplus_flow: that.data.surplus_flow
|
||||||
|
}, res => {
|
||||||
|
if (res.data.code == 200) {
|
||||||
|
wx.showToast({
|
||||||
|
title: '充值成功',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
that.getInfo()
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: res.data.msg,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
that.setData({
|
||||||
|
show6: false,
|
||||||
|
surplus_flow: ""
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
// 转零售
|
||||||
|
retailSet() {
|
||||||
|
let that = this
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '是否确认设置为零售模式?此操作请在设备通电开机的状态下进行操作',
|
||||||
|
complete: (res) => {
|
||||||
|
if (res.cancel) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res.confirm) {
|
||||||
|
util.postUrl4(apiArr.deviceToRetail, {
|
||||||
|
device_id: that.data.currentDevice.device_id
|
||||||
|
}, res => {
|
||||||
|
if (res.data.code == 200) {
|
||||||
|
wx.showToast({
|
||||||
|
title: '设置成功',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
that.getInfo()
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: res.data.msg,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
///////////////////////////////////////////////新增/////////////////////////////////////////////////////////////////////////
|
||||||
|
//开关机
|
||||||
|
openOff() {
|
||||||
|
let that = this
|
||||||
|
let onOff = ''
|
||||||
|
|
||||||
|
if (that.data.currentDevice.sevice_status == 1) {
|
||||||
|
onOff = 2
|
||||||
|
} else if (that.data.currentDevice.sevice_status == 2) {
|
||||||
|
onOff = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
wx.showLoading({
|
||||||
|
title: '操作中...',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
|
||||||
|
util.postUrl4(apiArr.openOff, {
|
||||||
|
deviceId: that.data.currentDevice.device_id,
|
||||||
|
onOff
|
||||||
|
}, res => {
|
||||||
|
wx.hideLoading()
|
||||||
|
if (res.msg == '操作成功') {
|
||||||
|
if (res.data.params.sevice_status.value == '00') {
|
||||||
|
wx.showToast({
|
||||||
|
title: '关机成功!',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
that.setData({
|
||||||
|
"currentDevice.sevice_status": 2
|
||||||
|
})
|
||||||
|
console.log('关机');
|
||||||
|
} else if (res.data.params.sevice_status.value == '10') {
|
||||||
|
wx.showToast({
|
||||||
|
title: '开机成功!',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
that.setData({
|
||||||
|
"currentDevice.sevice_status": 1
|
||||||
|
})
|
||||||
|
console.log('开机');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
updateChart(data) {
|
||||||
|
const ecComponent = this.selectComponent("#mychart-dom-bar");
|
||||||
|
if (!ecComponent) return;
|
||||||
|
|
||||||
|
this.setData({
|
||||||
|
chartData: data
|
||||||
|
});
|
||||||
|
|
||||||
|
ecComponent.init((canvas, width, height, dpr) => {
|
||||||
|
const chart = initChart(canvas, width, height, dpr);
|
||||||
|
chart.setOption({
|
||||||
|
grid: {
|
||||||
|
left: '3%', // 左边距
|
||||||
|
right: '4%', // 右边距
|
||||||
|
bottom: '3%', // 底部边距
|
||||||
|
containLabel: true // 确保标签包含在内
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
data: data.xAxis
|
||||||
|
},
|
||||||
|
series: [{
|
||||||
|
data: data.series,
|
||||||
|
label: { // 添加这个label配置
|
||||||
|
show: true, // 开启显示
|
||||||
|
position: 'top', // 位置在柱子上方
|
||||||
|
color: '#333', // 文字颜色
|
||||||
|
// fontSize: 8 // 文字大小
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
return chart;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
base64({ url, type }) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
wx.getFileSystemManager().readFile({
|
||||||
|
filePath: url, //选择图片返回的相对路径
|
||||||
|
encoding: 'base64', //编码格式
|
||||||
|
success: res => {
|
||||||
|
resolve('data:image/' + type.toLocaleLowerCase() + ';base64,' + res.data)
|
||||||
|
},
|
||||||
|
fail: res => reject(res.errMsg)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
convertCanvasToImage() {
|
||||||
|
wx.canvasToTempFilePath({
|
||||||
|
canvasId: 'myChart',
|
||||||
|
success: (res) => {
|
||||||
|
console.log(res.tempFilePath);
|
||||||
|
this.setData({
|
||||||
|
imagePath: res.tempFilePath
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.error('Canvas to image failed:', err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getDaysBetweenDates(inputDate) {
|
||||||
|
const currentDate = new Date();
|
||||||
|
// 将传入的日期字符串转换为日期对象
|
||||||
|
const targetDate = new Date(inputDate);
|
||||||
|
// 计算两个日期之间的时间差(以毫秒为单位)
|
||||||
|
const timeDifference = currentDate - targetDate;
|
||||||
|
// 将时间差转换为天数
|
||||||
|
const daysDifference = Math.floor(timeDifference / (1000 * 60 * 60 * 24));
|
||||||
|
// 返回天数
|
||||||
|
return daysDifference;
|
||||||
|
},
|
||||||
|
getDaysBetweenDates2(targetDate) {
|
||||||
|
// 获取当前日期(不含时间)
|
||||||
|
const today = new Date();
|
||||||
|
today.setHours(0, 0, 0, 0); // 时间归零,避免时间差影响
|
||||||
|
// 解析目标日期(格式:YYYY-MM-DD)
|
||||||
|
const target = new Date(targetDate);
|
||||||
|
target.setHours(0, 0, 0, 0);
|
||||||
|
// 计算毫秒差并转换为天数
|
||||||
|
const timeDiff = target - today;
|
||||||
|
const daysRemaining = Math.ceil(timeDiff / (1000 * 60 * 60 * 24));
|
||||||
|
return daysRemaining;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
id: options.device_id
|
||||||
|
})
|
||||||
|
that.getInfo()
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
let that = this
|
||||||
|
setTimeout(() => {
|
||||||
|
this.convertCanvasToImage()
|
||||||
|
}, 5000)
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
function initChart(canvas, width, height, dpr) {
|
||||||
|
const chart = echarts.init(canvas, null, {
|
||||||
|
width: width,
|
||||||
|
height: height,
|
||||||
|
devicePixelRatio: dpr // 将此选项设置为 2,可以在高分辨率屏幕上绘制更清晰的图表
|
||||||
|
});
|
||||||
|
canvas.setChart(chart);
|
||||||
|
const option = {
|
||||||
|
xAxis: {
|
||||||
|
type: 'category',
|
||||||
|
// data: ['16:41', '22:41', '04:41', '10:41', '16:41'],
|
||||||
|
data: []
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
type: 'value',
|
||||||
|
// data: ['0ml', '560ml']
|
||||||
|
min: 0,
|
||||||
|
axisLabel: {
|
||||||
|
formatter: '{value}ml'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
series: [{
|
||||||
|
// data: [150, 230, 224, 218, 135, 147, 345],
|
||||||
|
data: [],
|
||||||
|
type: 'bar',
|
||||||
|
barWidth: 15,
|
||||||
|
itemStyle: { //柱状颜色和圆角
|
||||||
|
color: {
|
||||||
|
x: 0,
|
||||||
|
y: 1,
|
||||||
|
colorStops: [{
|
||||||
|
offset: 0,
|
||||||
|
color: '#FFBBAC',
|
||||||
|
}, {
|
||||||
|
offset: 1,
|
||||||
|
color: '#338BFF'
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
barBorderRadius: [5, 5, 0, 0], // (顺时针左上,右上,右下,左下)
|
||||||
|
},
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
chart.setOption(option);
|
||||||
|
return chart;
|
||||||
|
}
|
||||||
6
packages/partner/pages/deviceDesc/deviceDesc.json
Normal file
6
packages/partner/pages/deviceDesc/deviceDesc.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {
|
||||||
|
"ec-canvas": "/component/ec-canvas/ec-canvas"
|
||||||
|
},
|
||||||
|
"navigationBarTitleText": "设备详情"
|
||||||
|
}
|
||||||
298
packages/partner/pages/deviceDesc/deviceDesc.wxml
Normal file
298
packages/partner/pages/deviceDesc/deviceDesc.wxml
Normal file
@ -0,0 +1,298 @@
|
|||||||
|
<!--pages/water_filter/water_filter.wxml-->
|
||||||
|
<!-- 人人爱净水页面 -->
|
||||||
|
<view class="water-filter">
|
||||||
|
<view class="top" style="background-image: url('https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/Group_401.png?v1'); background-size: 100% 100%; height: 698rpx; width: 100%;">
|
||||||
|
<!-- 位置定位 -->
|
||||||
|
<view class="positioning">
|
||||||
|
<view class="positioning-left">
|
||||||
|
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/Group 38.png" mode="" class="positioning-icon-left" />
|
||||||
|
<text class="positioning-text">{{currentDevice.region + currentDevice.address}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 净化前后数值 -->
|
||||||
|
<view class="purification-value">
|
||||||
|
<view class="purification-value-left">
|
||||||
|
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/Group_420.png?v1" mode="" class="purification-value-icon" />
|
||||||
|
<view class="purification-value-text">
|
||||||
|
<text class="front puri-text">净化前</text>
|
||||||
|
<text class="tds puri-text">水质TDS值</text>
|
||||||
|
<text class="tds-value puri-text">{{currentDevice.raw_water_value}}</text>
|
||||||
|
<text class="ppm puri-text">PPM</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<view class="purification-value-left purification-value-right">
|
||||||
|
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/Group_420.png?v1" mode="" class="purification-value-icon" />
|
||||||
|
<view class="purification-value-text">
|
||||||
|
<text class="front puri-text">净化后</text>
|
||||||
|
<text class="tds puri-text">水质TDS值</text>
|
||||||
|
<text class="tds-value puri-text">{{currentDevice.purification_water_value}}</text>
|
||||||
|
<text class="ppm puri-text">PPM</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 净化前后水质 -->
|
||||||
|
<view class="water-quality">
|
||||||
|
<view class="water-quality-left">
|
||||||
|
<text class="water-quality-text" wx:if="{{ currentDevice.raw_water_value < 20 }}">净化前水质:极好</text>
|
||||||
|
<text class="water-quality-text" wx:if="{{currentDevice.raw_water_value >= 20 && currentDevice.raw_water_value < 50 }}">净化前水质:良好</text>
|
||||||
|
<text class="water-quality-text" wx:if="{{ currentDevice.raw_water_value >= 50 && currentDevice.raw_water_value < 150 }}">净化前水质:正常</text>
|
||||||
|
<text class="water-quality-text" wx:if="{{currentDevice.raw_water_value >= 150 && currentDevice.raw_water_value < 300 }}">净化前水质:较差</text>
|
||||||
|
<text class="water-quality-text" wx:if="{{ currentDevice.raw_water_value >= 300 }}">净化前水质:极差</text>
|
||||||
|
</view>
|
||||||
|
<view class="water-quality-right water-quality-left" style="margin-left: 60rpx;">
|
||||||
|
<text class="water-quality-text" wx:if="{{ currentDevice.purification_water_value < 20 }}">净化后水质:极好</text>
|
||||||
|
<text class="water-quality-text" wx:if="{{currentDevice.purification_water_value >= 20 && currentDevice.purification_water_value < 50 }}">净化后水质:良好</text>
|
||||||
|
<text class="water-quality-text" wx:if="{{ currentDevice.purification_water_value >= 50 && currentDevice.purification_water_value < 150 }}">净化后水质:正常</text>
|
||||||
|
<text class="water-quality-text" wx:if="{{currentDevice.purification_water_value >= 150 && currentDevice.purification_water_value < 300 }}">净化后水质:较差</text>
|
||||||
|
<text class="water-quality-text" wx:if="{{ currentDevice.purification_water_value >= 300 }}">净化后水质:极差</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view>
|
||||||
|
<!-- 我的设备信息 -->
|
||||||
|
<view class="my-device">
|
||||||
|
<!-- <text class="mydevice text-color">我的设备</text> -->
|
||||||
|
<view class="device-info">
|
||||||
|
<text class="mydevice text-color">我的设备</text>
|
||||||
|
<view class="info-top">
|
||||||
|
<view class="device-name">{{currentDevice.product_name}}</view>
|
||||||
|
|
||||||
|
<view class="device-state">
|
||||||
|
<image wx:if="{{currentDevice.sevice_status == '2'}}" bind:tap="openOff" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/Group_405.png?v1" mode="" class="switch-icon" />
|
||||||
|
<image wx:if="{{currentDevice.sevice_status == '1'}}" bind:tap="openOff" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/openBtn.png" mode="" class="switch-icon" />
|
||||||
|
<text class="switch-text text-color text-size" bind:tap="openOff" wx:if="{{currentDevice.sevice_status == '1'}}">开机</text>
|
||||||
|
<text class="switch-text text-color text-size" bind:tap="openOff" wx:if="{{currentDevice.sevice_status == '2'}}">关机</text>
|
||||||
|
<text class="switch-text text-color text-size" wx:if="{{currentDevice.sevice_status == '3'}}">制水故障</text>
|
||||||
|
<text class="switch-text text-color text-size" wx:if="{{currentDevice.sevice_status == '4'}}">漏水故障</text>
|
||||||
|
<text class="switch-text text-color text-size" wx:if="{{currentDevice.sevice_status == '5'}}">主板故障</text>
|
||||||
|
|
||||||
|
|
||||||
|
<image wx:if="{{currentDevice.network_status != '1'}}" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/mdicon3.png" mode="" class="wifi-icon" />
|
||||||
|
<image wx:if="{{currentDevice.network_status == 1}}" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/mdicon4.png" mode="" class="wifi-icon" />
|
||||||
|
<text class="wifi-text text-color text-size">{{currentDevice.network_status == '1'?'在线':'离线'}}</text>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="info-bottom">
|
||||||
|
<view class="device-id text-size">
|
||||||
|
编号:{{currentDevice.device_code}}
|
||||||
|
</view>
|
||||||
|
<view class="service-day text-size text-color" wx:if="{{currentDevice.expiration_duration}}">
|
||||||
|
已服务<span class="day-num">{{currentDevice.difDay}}</span><span class="day text-size">天</span>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="service-day text-size text-color" wx:if="{{!currentDevice.expiration_duration}}">
|
||||||
|
已服务<span class="day-num">0</span><span class="day text-size">天</span>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<view wx:if="{{currentDevice.expiration_duration}}">
|
||||||
|
<view class="service-day text-size text-color" wx:if="{{currentDevice.status != 8}}">
|
||||||
|
剩余天数
|
||||||
|
<span class="day-num2">{{ currentDevice.remainDay}}</span>
|
||||||
|
<span class="day text-size">天</span>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="service-day text-size text-color" wx:if="{{ currentDevice.status == 8}}">
|
||||||
|
<span class="day text-size">已欠费</span>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view wx:if="{{!currentDevice.expiration_duration}}">
|
||||||
|
<view class="service-day text-size text-color" wx:if="{{ currentDevice.status != 1 && currentDevice.status != 8}}">
|
||||||
|
剩余天数
|
||||||
|
<span class="day-num2">0</span>
|
||||||
|
<span class="day text-size">天</span>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<van-divider />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 滤芯寿命 -->
|
||||||
|
<view class="lifetime">
|
||||||
|
<view class="lifetime-title">滤芯寿命</view>
|
||||||
|
<view class="lifetime-prompt">滤芯寿命用水量和使用时间来综合计算</view>
|
||||||
|
|
||||||
|
<view>
|
||||||
|
<view wx:for="{{currentDevice.parts}}" wx:key="index">
|
||||||
|
|
||||||
|
<view class="progress-name">
|
||||||
|
<view>{{item.parts_name}}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="lifetime-progress">
|
||||||
|
<view style="display: flex;flex: 1;" wx:if="{{currentDevice.billing_method == 1}}">
|
||||||
|
<van-progress style="width: 100%;" percentage="{{item.percentageDay}}" color="linear-gradient(to right, #FFBBAC, #338BFF)" stroke-width="10" show-pivot="{{false}}" track-color="#F1F1F1" />
|
||||||
|
<text class="progress">{{item.percentageDay}}%</text>
|
||||||
|
</view>
|
||||||
|
<view style="display: flex;flex: 1;" wx:if="{{currentDevice.billing_method == 2}}">
|
||||||
|
<van-progress style="width: 100%;" percentage="{{item.percentageCapacity}}" color="linear-gradient(to right, #FFBBAC, #338BFF)" stroke-width="10" show-pivot="{{false}}" track-color="#F1F1F1" />
|
||||||
|
<text class="progress">{{item.percentageCapacity}}%</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view style="display: flex;flex: 1;" wx:if="{{currentDevice.billing_method == 3}}">
|
||||||
|
<van-progress style="width: 100%;" percentage="{{item.percentageDay}}" color="linear-gradient(to right, #FFBBAC, #338BFF)" stroke-width="10" show-pivot="{{false}}" track-color="#F1F1F1" />
|
||||||
|
<text class="progress">{{item.percentageDay}}%</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<view class="replayBtn" bind:tap="replay" data-item="{{item}}" wx:if="{{currentDevice.billing_method != 3}}">
|
||||||
|
重置
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<!-- 用水量 -->
|
||||||
|
<view class="water-consumption">
|
||||||
|
<view class="water-consumption-title">用水量</view>
|
||||||
|
<!-- 用水量统计 -->
|
||||||
|
|
||||||
|
<view class="water-consumption-row">
|
||||||
|
<view class="water-consumption-col">
|
||||||
|
<view class="water-consumption-col-name">累计用水量</view>
|
||||||
|
<view class="water-consumption-col-num">{{currentDevice.cumulative_filtration_flow}}<span class="water-consumption-col-num-size">L</span></view>
|
||||||
|
</view>
|
||||||
|
<view class="water-consumption-col col2">
|
||||||
|
<view class="water-consumption-col-name">今日用水量</view>
|
||||||
|
<view class="water-consumption-col-num">{{currentDevice.today}}<span class="water-consumption-col-num-size">L</span></view>
|
||||||
|
</view>
|
||||||
|
<view class="water-consumption-col col3">
|
||||||
|
<view class="water-consumption-col-name">昨日用水量</view>
|
||||||
|
<view class="water-consumption-col-num">{{currentDevice.yesterday}}<span class="water-consumption-col-num-size">L</span></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 用水量柱状图 -->
|
||||||
|
<view class="container">
|
||||||
|
<ec-canvas id="mychart-dom-bar" canvasId="mychart-dom-bar" type="2d" ec="{{ ec }}" ec="{{ ec }}"></ec-canvas>
|
||||||
|
<image src="{{imagePath}}" style="width: 100%;height:600rpx;"></image>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<view class="deleteBtn" bind:tap="uninstall" wx:if="{{currentDevice.status == 1 || currentDevice.status == 3 || currentDevice.status == 5 || currentDevice.status == 6 || currentDevice.status == 8}}">
|
||||||
|
拆机
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="btn3" bind:tap="active" wx:if="{{currentDevice.status == 1 || currentDevice.status == 3 || currentDevice.status == 5 || currentDevice.status == 6 || currentDevice.status == 8}}">
|
||||||
|
激活
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="btn4" bind:tap="recharge2" wx:if="{{currentDevice.billing_method == 2}}">
|
||||||
|
流量充值
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="btn4" bind:tap="recharge1" wx:if="{{currentDevice.billing_method == 1 &¤tDevice.status == 1 || currentDevice.status == 3 || currentDevice.status == 5 || currentDevice.status == 6 || currentDevice.status == 8}}">
|
||||||
|
时长充值
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- wx:if="{{currentDevice.billing_method == 1}}" -->
|
||||||
|
<view class="btn5" bind:tap="timeSet" wx:if="{{currentDevice.status == 1 || currentDevice.status == 3 || currentDevice.status == 5 || currentDevice.status == 6 || currentDevice.status == 8}}">
|
||||||
|
转时长
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- wx:if="{{currentDevice.billing_method == 2}}" -->
|
||||||
|
<view class="btn5" bind:tap="timeSet2" wx:if="{{currentDevice.status == 1 || currentDevice.status == 3 || currentDevice.status == 5 || currentDevice.status == 6 || currentDevice.status == 8}}">
|
||||||
|
转流量
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="btn5" bind:tap="retailSet" wx:if="{{currentDevice.status == 1 || currentDevice.status == 3 || currentDevice.status == 5 || currentDevice.status == 6 || currentDevice.status == 8}}">
|
||||||
|
转零售
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<van-popup show="{{ show }}" safe-area-inset-bottom lock-scroll bind:close="onClose" round close-on-click-overlay position="bottom">
|
||||||
|
<van-datetime-picker bind:cancel="onClose" formatter="{{ formatter }}" type="datetime" min-date="{{ minDate }}" bind:confirm="onInput" />
|
||||||
|
</van-popup>
|
||||||
|
|
||||||
|
<!-- -->
|
||||||
|
<van-popup show="{{ show2 }}" position="bottom" safe-area-inset-bottom round bind:close="onClose2">
|
||||||
|
<view class="tit">
|
||||||
|
<view class="cancel" bind:close="onClose2">取消</view>
|
||||||
|
<view class="sub" bind:tap="createUninstall">确定</view>
|
||||||
|
</view>
|
||||||
|
<view class="row2">
|
||||||
|
<view class="row_label">预约时间:</view>
|
||||||
|
<input class="value" bind:tap="changeUninstallDate" value="{{uninstall_time}}" disabled placeholder="请选择预约时间" />
|
||||||
|
</view>
|
||||||
|
<view class="row">
|
||||||
|
<view class="row_label">备注:</view>
|
||||||
|
<view class="row_con">
|
||||||
|
<textarea placeholder="请输入备注" bindinput="remarksIpt1"></textarea>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
</van-popup>
|
||||||
|
<!-- 时长充值 -->
|
||||||
|
<van-popup show="{{ show4 }}" position="bottom" safe-area-inset-bottom round bind:close="onClose2">
|
||||||
|
<view class="tit">
|
||||||
|
<view class="cancel" bind:close="onClose2">取消</view>
|
||||||
|
<view class="sub" bind:tap="deviceDeactivation">确定</view>
|
||||||
|
</view>
|
||||||
|
<view class="row">
|
||||||
|
<view class="row_label">充值天数:</view>
|
||||||
|
<view class="row_con">
|
||||||
|
<input type="number" value="{{remainingDays}}" bindinput="changeRemainingDay" placeholder="请输入充值天数" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</van-popup>
|
||||||
|
|
||||||
|
<van-popup show="{{ show3 }}" position="bottom" safe-area-inset-bottom round bind:close="onClose2">
|
||||||
|
<view class="tit">
|
||||||
|
<view class="cancel" bind:close="onClose2">取消</view>
|
||||||
|
<view class="sub" bind:tap="deviceDataForce">确定</view>
|
||||||
|
</view>
|
||||||
|
<view class="row">
|
||||||
|
<view class="row_label">设置数额:</view>
|
||||||
|
<view class="row_con">
|
||||||
|
<textarea placeholder="请输入数额" value="{{surplusFlow}}" bindinput="changeSurplusFlow"></textarea>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</van-popup>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 转时长 -->
|
||||||
|
<van-popup show="{{ show5 }}" position="bottom" safe-area-inset-bottom round bind:close="onClose2">
|
||||||
|
<view class="tit">
|
||||||
|
<view class="cancel" bind:close="onClose2">取消</view>
|
||||||
|
<view class="sub" bind:tap="modeToTime">确定</view>
|
||||||
|
</view>
|
||||||
|
<view class="row">
|
||||||
|
<view class="row_label">充值天数:</view>
|
||||||
|
<view class="row_con">
|
||||||
|
<input type="number" value="{{remaining_days}}" bindinput="changeRemainingDay2" placeholder="请输入充值天数" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</van-popup>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 转流量 -->
|
||||||
|
<van-popup show="{{ show6 }}" position="bottom" safe-area-inset-bottom round bind:close="onClose2">
|
||||||
|
<view class="tit">
|
||||||
|
<view class="cancel" bind:close="onClose2">取消</view>
|
||||||
|
<view class="sub" bind:tap="modeToFlowRate">确定</view>
|
||||||
|
</view>
|
||||||
|
<view class="row">
|
||||||
|
<view class="row_label">设置数额:</view>
|
||||||
|
<view class="row_con">
|
||||||
|
<input type="number" value="{{surplus_flow}}" bindinput="changeRemainingDay3" placeholder="请输入数额" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</van-popup>
|
||||||
|
|
||||||
|
|
||||||
|
<van-popup show="{{ UninstallDateShow }}" bind:close="closeUninstallDate" safe-area-inset-bottom position="bottom" close-on-click-overlay>
|
||||||
|
<van-datetime-picker title="预约时间" bind:cancel="closeUninstallDate" formatter="{{ formatter }}" type="datetime" min-date="{{ minDate }}" bind:confirm="onInput2" />
|
||||||
|
</van-popup>
|
||||||
742
packages/partner/pages/deviceDesc/deviceDesc.wxss
Normal file
742
packages/partner/pages/deviceDesc/deviceDesc.wxss
Normal file
@ -0,0 +1,742 @@
|
|||||||
|
.nav-box {
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 100%;
|
||||||
|
position: relative;
|
||||||
|
/* position: fixed; */
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-box .nav-bar {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-box .nav-bar .nav-bar-left,
|
||||||
|
.nav-box .nav-bar .nav-bar-right {
|
||||||
|
padding: 0 20rpx;
|
||||||
|
min-width: 36rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-box .nav-bar .nav-bar-left van-icon {
|
||||||
|
vertical-align: sub;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-box .nav-bar .nav-bar-title {
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-box .nav-bar-title {
|
||||||
|
color: red;
|
||||||
|
margin-left: -20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.water-filter {
|
||||||
|
width: 100vw;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nowrap {
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top {
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 位置定位 */
|
||||||
|
.positioning {
|
||||||
|
display: flex;
|
||||||
|
margin-left: 24rpx;
|
||||||
|
padding-top: 40rpx;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
margin-bottom: 64rpx;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.positioning-left {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.positioning-right {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.positioning-icon-left {
|
||||||
|
width: 33rpx;
|
||||||
|
height: 33rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.positioning-text {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
margin-left: 9rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
.positioning-icon-right {
|
||||||
|
width: 24rpx;
|
||||||
|
height: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 净化前后数值 */
|
||||||
|
.purification-value {
|
||||||
|
display: flex;
|
||||||
|
margin-left: 114rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.purification-value-left {
|
||||||
|
display: inline;
|
||||||
|
width: 210rpx;
|
||||||
|
height: 250rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.purification-value-right {
|
||||||
|
margin-left: 116rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.purification-value-icon {
|
||||||
|
width: 210rpx;
|
||||||
|
height: 250rpx;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
.purification-value-text {
|
||||||
|
position: absolute;
|
||||||
|
margin: 60rpx 42rpx 0 41rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.puri-text {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
color: #FFFFFF;
|
||||||
|
font-size: 26rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tds {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tds-value {
|
||||||
|
font-size: 50rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 净化前后水质 */
|
||||||
|
.water-quality {
|
||||||
|
margin-left: 80rpx;
|
||||||
|
margin-top: 23rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.water-quality2 {
|
||||||
|
display: flex;
|
||||||
|
margin: 0 80rpx;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.water-quality2 .water-quality-left {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
text-align: center;
|
||||||
|
height: auto;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.water-quality2 .water-quality-text {
|
||||||
|
width: 150rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 100rpx 100rpx 100rpx 100rpx;
|
||||||
|
color: #2583FF;
|
||||||
|
display: block;
|
||||||
|
line-height: 50rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.water-quality-left {
|
||||||
|
display: inline;
|
||||||
|
width: 265rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
padding: 10rpx 38rpx 10rpx 30rpx;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
background: linear-gradient(to right, #2583FF1a, #2583FF);
|
||||||
|
}
|
||||||
|
|
||||||
|
.water-quality-text {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 我的设备 */
|
||||||
|
.my-device {
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
/* margin: 0 24rpx 0 20rpx; */
|
||||||
|
/* padding-bottom: 30rpx; */
|
||||||
|
}
|
||||||
|
|
||||||
|
.mydevice {
|
||||||
|
font-size: 28rpx;
|
||||||
|
display: flex;
|
||||||
|
margin-bottom: 23rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-color {
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.replayBtn {
|
||||||
|
width: 120rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background-color: #2887ff;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
margin-left: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.day-num2 {
|
||||||
|
color: #ff0000da;
|
||||||
|
font-size: 36rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
margin: 0 7rpx 0 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-info {
|
||||||
|
margin: 0 24rpx 0 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-top {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-name {
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #222222;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-state {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.switch-icon {
|
||||||
|
width: 28rpx;
|
||||||
|
height: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.switch-text {
|
||||||
|
margin-right: 31rpx;
|
||||||
|
margin-left: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wifi-text {
|
||||||
|
margin-left: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-size {
|
||||||
|
font-size: 26rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wifi-icon {
|
||||||
|
width: 30rpx;
|
||||||
|
height: 22rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-bottom {
|
||||||
|
display: flex;
|
||||||
|
margin-top: 22rpx;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-id {
|
||||||
|
color: #2583FF;
|
||||||
|
/* display: inline; */
|
||||||
|
}
|
||||||
|
|
||||||
|
.service-day {
|
||||||
|
/* display: inline; */
|
||||||
|
/* float: right; */
|
||||||
|
}
|
||||||
|
|
||||||
|
.day-num {
|
||||||
|
color: #2583FF;
|
||||||
|
font-size: 36rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
margin: 0 7rpx 0 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.day {
|
||||||
|
color: #222222;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 购买滤芯和报修记录 */
|
||||||
|
.van-row {
|
||||||
|
padding: 0 20rpx !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.van-col {
|
||||||
|
display: flex;
|
||||||
|
background-color: #FFF0ED;
|
||||||
|
height: 150rpx;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.purchase {
|
||||||
|
width: 100rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
margin-left: 68rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 功能列表 */
|
||||||
|
.van-grid {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.van-icon__image {
|
||||||
|
width: 100rpx !important;
|
||||||
|
height: 100rpx !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.van-icon--image {
|
||||||
|
width: 100rpx !important;
|
||||||
|
height: 100rpx !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.van-grid-item__text {
|
||||||
|
font-size: 26rpx !important;
|
||||||
|
color: #222222 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 滤芯寿命 */
|
||||||
|
.lifetime {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
padding: 30rpx 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lifetime-title {
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lifetime-prompt {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999999;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
margin-bottom: 25rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lifetime-progress {
|
||||||
|
margin-top: 10rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress-name {
|
||||||
|
white-space: nowrap;
|
||||||
|
/* width: 24%; */
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
font-size: 26rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding-top: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.van-progress {
|
||||||
|
width: 100%;
|
||||||
|
margin-right: 19rpx;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress {
|
||||||
|
color: #000000;
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contral3 {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.equi-contral-right2 {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 用水量 */
|
||||||
|
.water-consumption {
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
padding: 30rpx 24rpx 0 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.water-consumption-title {
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row-index--van-row {
|
||||||
|
margin: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.van-col--8 {
|
||||||
|
display: inline;
|
||||||
|
height: 130rpx !important;
|
||||||
|
width: 220rpx !important;
|
||||||
|
margin-right: 5rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.water-consumption-col-name {
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: normal;
|
||||||
|
color: #000000;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 12rpx;
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.water-consumption-col-num {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 38rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #2583FF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.water-consumption-col-num-size {
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
width: 100%;
|
||||||
|
height: 600rpx;
|
||||||
|
padding-bottom: 100rpx;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.container canvas {
|
||||||
|
position: absolute;
|
||||||
|
right: -100vw;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#mychart-bar {
|
||||||
|
border-radius: 30rpx 30rpx 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chart {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
height: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bar {
|
||||||
|
width: 20px;
|
||||||
|
margin: 0 5px;
|
||||||
|
background-color: blue;
|
||||||
|
border-radius: 30rpx 30rpx 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.water-consumption-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.water-consumption-col {
|
||||||
|
width: 220rpx;
|
||||||
|
height: 112rpx;
|
||||||
|
background: linear-gradient(180deg, #F0F4FF 0%, #DEE7FF 100%);
|
||||||
|
border-radius: 20rpx 20rpx 20rpx 20rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.water-consumption-row .col2 {
|
||||||
|
background: linear-gradient(180deg, #FFFBD8 0%, #FFEBB8 100%);
|
||||||
|
margin: 0 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.water-consumption-row .col3 {
|
||||||
|
background: linear-gradient(180deg, #ECECEC 0%, #E5E4E4 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.water-consumption-col .water-consumption-col-name {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.water-consumption-col .water-consumption-col-num {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #2583FF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.equi-contral {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-left: 20rpx;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.equi-contral2 .equi-contral-right {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.equi-contral2 .equi-contral-right .equi-contral-right-btn2 {
|
||||||
|
margin-top: 0;
|
||||||
|
width: 335rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.equi-contral2 .equi-contral-right .equi-contral-right-btn1 {
|
||||||
|
margin-top: 0;
|
||||||
|
width: 335rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.equi-contral-left {
|
||||||
|
position: relative;
|
||||||
|
width: 345rpx;
|
||||||
|
height: 320rpx;
|
||||||
|
background: #FFF0ED;
|
||||||
|
border-radius: 30rpx 30rpx 30rpx 30rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #000000;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding-top: 58rpx;
|
||||||
|
padding-left: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.equi-contral-left #img1 {
|
||||||
|
width: 219.21rpx;
|
||||||
|
height: 175rpx;
|
||||||
|
position: absolute;
|
||||||
|
left: 116rpx;
|
||||||
|
bottom: 5rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.equi-contral-left #img2 {
|
||||||
|
width: 119rpx;
|
||||||
|
height: 95rpx;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 32rpx;
|
||||||
|
left: 180rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.van-grid-item__text text {
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.equi-contral-right {
|
||||||
|
/* justify-content: center !important; */
|
||||||
|
}
|
||||||
|
|
||||||
|
.equi-contral-right-btn1 {
|
||||||
|
width: 345rpx;
|
||||||
|
height: 150rpx;
|
||||||
|
background: linear-gradient(180deg, #FFFBD8 0%, #FFEBB8 100%);
|
||||||
|
border-radius: 20rpx 20rpx 20rpx 20rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #000000;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding-left: 30rpx;
|
||||||
|
padding-right: 30rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.equi-contral-right-btn1 image {
|
||||||
|
width: 100rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.equi-contral-right-btn2 {
|
||||||
|
width: 345rpx;
|
||||||
|
height: 150rpx;
|
||||||
|
background: linear-gradient(180deg, #ECECEC 0%, #E5E4E4 100%);
|
||||||
|
border-radius: 20rpx 20rpx 20rpx 20rpx;
|
||||||
|
margin-top: 23rpx;
|
||||||
|
position: relative;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #000000;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding-left: 30rpx;
|
||||||
|
padding-right: 30rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.equi-contral-right-btn2 image {
|
||||||
|
width: 100rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.foot-fixed {
|
||||||
|
z-index: 999999999999 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btnDevice {
|
||||||
|
width: 650rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
background: #2583FF;
|
||||||
|
border-radius: 100rpx 100rpx 100rpx 100rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 300rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deleteBtn {
|
||||||
|
width: 710rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
background-color: #dd0000;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
font-size: 34rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.btn3 {
|
||||||
|
background: #D5AC66;
|
||||||
|
width: 710rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
font-size: 34rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn4 {
|
||||||
|
background: #67C23A;
|
||||||
|
width: 710rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
font-size: 34rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 40rpx;
|
||||||
|
}
|
||||||
|
.btn5{
|
||||||
|
background-color: #909399;
|
||||||
|
width: 710rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
font-size: 34rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row {
|
||||||
|
padding-top: 30rpx;
|
||||||
|
height: 300rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
overflow-y: auto;
|
||||||
|
padding: 30rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-size: 30rpx;
|
||||||
|
display: flex;
|
||||||
|
color: #606266;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row_label {
|
||||||
|
margin-right: 20rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row_con {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row_con textarea {
|
||||||
|
height: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tit {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
font-size: 32rpx;
|
||||||
|
padding-right: 30rpx;
|
||||||
|
padding-left: 30rpx;
|
||||||
|
padding-top: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row2 {
|
||||||
|
padding-top: 30rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
overflow-y: auto;
|
||||||
|
padding: 30rpx;
|
||||||
|
padding-bottom: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-size: 30rpx;
|
||||||
|
display: flex;
|
||||||
|
color: #606266;
|
||||||
|
}
|
||||||
222
packages/partner/pages/distributor/distributor.js
Normal file
222
packages/partner/pages/distributor/distributor.js
Normal file
@ -0,0 +1,222 @@
|
|||||||
|
let util = require('../../../../utils/util')
|
||||||
|
let apiArr = require('../../../../api/partner')
|
||||||
|
// packages/partner/pages/distributor/distributor.js
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
show: false,
|
||||||
|
deviceList: [],
|
||||||
|
deal: {},
|
||||||
|
deviceInfo:{
|
||||||
|
device_code:""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
choseJXS() {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
show: true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//扫码
|
||||||
|
scanQrcode() {
|
||||||
|
let that = this
|
||||||
|
wx.scanCode({
|
||||||
|
success: (res) => {
|
||||||
|
// 处理扫码结果
|
||||||
|
this.setData({
|
||||||
|
deviceCode: res.result
|
||||||
|
});
|
||||||
|
util.postUrl4(apiArr.getDeviceByCode, {
|
||||||
|
device_code: res.result,
|
||||||
|
install_id: that.data.id
|
||||||
|
}, res => {
|
||||||
|
let deviceList = that.data.deviceList
|
||||||
|
deviceList.push(res)
|
||||||
|
that.setData({
|
||||||
|
deviceList
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
wx.showToast({
|
||||||
|
title: '扫码失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
iptDeviceCode(e){
|
||||||
|
let that = this
|
||||||
|
console.log(e);
|
||||||
|
that.setData({
|
||||||
|
"deviceInfo.device_code":e.detail.value
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
search(){
|
||||||
|
let that = this
|
||||||
|
console.log(that.data.deviceInfo);
|
||||||
|
util.postUrl4(apiArr.getDeviceByCode, {
|
||||||
|
device_code: that.data.deviceInfo.device_code,
|
||||||
|
install_id: that.data.id
|
||||||
|
}, res => {
|
||||||
|
let deviceList = that.data.deviceList
|
||||||
|
deviceList.push(res)
|
||||||
|
that.setData({
|
||||||
|
deviceList
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//经销商列表
|
||||||
|
getDealerList() {
|
||||||
|
let that = this
|
||||||
|
util.postUrl4(apiArr.getPartnerList, {
|
||||||
|
page_size: 50,
|
||||||
|
page_num: 1
|
||||||
|
}, res => {
|
||||||
|
console.log(res);
|
||||||
|
that.setData({
|
||||||
|
columns: res.rows
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
deleteItem(e){
|
||||||
|
console.log(e);
|
||||||
|
let that = this
|
||||||
|
let deviceList = that.data.deviceList
|
||||||
|
deviceList.splice(e.currentTarget.dataset.idx,1)
|
||||||
|
that.setData({
|
||||||
|
deviceList
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
onClose() {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
show: false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onConfirm(e) {
|
||||||
|
console.log(e);
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
deal: e.detail.value,
|
||||||
|
show: false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
allocation() {
|
||||||
|
let that = this
|
||||||
|
let device_id = []
|
||||||
|
|
||||||
|
if (!that.data.deal.deal_id) {
|
||||||
|
return wx.showToast({
|
||||||
|
title: '请选择经销商',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (that.data.deviceList.length == 0) {
|
||||||
|
return wx.showToast({
|
||||||
|
title: '请添加设备',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
that.data.deviceList.forEach(item => {
|
||||||
|
device_id.push(item.device_id)
|
||||||
|
})
|
||||||
|
util.postUrl4(apiArr.allocation, {
|
||||||
|
dealer_id: that.data.deal.deal_id,
|
||||||
|
device_id
|
||||||
|
}, res => {
|
||||||
|
wx.showToast({
|
||||||
|
title: '分配成功!',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
|
||||||
|
that.setData({
|
||||||
|
deal:{},
|
||||||
|
deviceList:[]
|
||||||
|
})
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
cancels(){
|
||||||
|
let that= this
|
||||||
|
that.setData({
|
||||||
|
deviceList:[],
|
||||||
|
deal:{}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
deleteItem(e) {
|
||||||
|
console.log(e);
|
||||||
|
let that = this
|
||||||
|
let deviceList = that.data.deviceList
|
||||||
|
deviceList.splice(e.currentTarget.dataset.idx, 1)
|
||||||
|
that.setData({
|
||||||
|
deviceList
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
this.getDealerList()
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
4
packages/partner/pages/distributor/distributor.json
Normal file
4
packages/partner/pages/distributor/distributor.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {},
|
||||||
|
"navigationBarTitleText": "设备分配"
|
||||||
|
}
|
||||||
101
packages/partner/pages/distributor/distributor.wxml
Normal file
101
packages/partner/pages/distributor/distributor.wxml
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
<view class="container">
|
||||||
|
|
||||||
|
|
||||||
|
<view class="btns" bind:tap="scanQrcode">扫码添加设备</view>
|
||||||
|
|
||||||
|
<view class="iptBox">
|
||||||
|
<span class="label">设备编码:</span>
|
||||||
|
<input type="text" confirm-type="search" bindconfirm="search" value="{{deviceInfo.device_code}}" bind:input="iptDeviceCode" placeholder="请输入设备编码" />
|
||||||
|
<view class="searchBox" bind:tap="search">
|
||||||
|
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/water_filter/dervice/deriveSearch.png?1" mode="widthFix" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="choseJXS">
|
||||||
|
<view class="label">
|
||||||
|
经销商:
|
||||||
|
</view>
|
||||||
|
<view class="con">
|
||||||
|
<input type="text" value="{{deal.deal_name}}" placeholder="请选择经销商" bind:tap="choseJXS" disabled />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="choseJXS2">
|
||||||
|
<view class="label">
|
||||||
|
扫码台数:
|
||||||
|
</view>
|
||||||
|
<view class="con">
|
||||||
|
<input type="text" value="{{deviceList.length}}" placeholder="0" bind:tap="choseJXS" disabled />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="deviceList">
|
||||||
|
<view class="deviceList_tit">
|
||||||
|
<view class="deviceList_tit_item">产品名称</view>
|
||||||
|
<view class="deviceList_tit_item">设备编码</view>
|
||||||
|
<view class="deviceList_tit_item">操作</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="deviceList_item" wx:for="{{deviceList}}">
|
||||||
|
<view class="deviceList_item_con">{{item.product_name}}</view>
|
||||||
|
<view class="deviceList_item_con">{{item.device_code}}</view>
|
||||||
|
<view class="deviceList_item_con dele" bind:tap="deleteItem" data-idx="{{index}}">删除</view>
|
||||||
|
</view>
|
||||||
|
<!-- <view class="deviceItem" wx:for="{{deviceList}}">
|
||||||
|
<view class="row">
|
||||||
|
<view class="row_label">设备名称:</view>
|
||||||
|
<view class="row_con">{{item.product_name}}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="row">
|
||||||
|
<view class="row_label">设备编码:</view>
|
||||||
|
<view class="row_con">{{item.device_code}}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="row">
|
||||||
|
<view class="row_label">计费方式:</view>
|
||||||
|
<text class="row_con" wx:if="{{item.billing_method == 1}}">时长模式</text>
|
||||||
|
<text class="row_con" wx:if="{{item.billing_method == 2}}">流量模式</text>
|
||||||
|
<text class="row_con" wx:if="{{item.billing_method == 3}}">零售模式</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="row">
|
||||||
|
<view class="row_label">设备ICCID</view>
|
||||||
|
<view class="row_con">{{item.device_iccid}}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="row">
|
||||||
|
<view class="row_label">设备IMEI</view>
|
||||||
|
<view class="row_con">{{item.device_imei}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="row">
|
||||||
|
<view class="row_label">安装状态</view>
|
||||||
|
<text class="row_con" wx:if="{{item.install_status == 1}}">已安装</text>
|
||||||
|
<text class="row_con" wx:if="{{item.install_status == 2}}">空闲</text>
|
||||||
|
<text class="row_con" wx:if="{{item.install_status == 3}}">已拆机</text>
|
||||||
|
</view>
|
||||||
|
<view class="row">
|
||||||
|
<view class="row_label">服务状态</view>
|
||||||
|
<text class="row_con" wx:if="{{item.sevice_status == 1}}">开机</text>
|
||||||
|
<text class="row_con" wx:if="{{item.sevice_status == 2}}">关机</text>
|
||||||
|
<text class="row_con" wx:if="{{item.sevice_status == 3}}">制水故障</text>
|
||||||
|
<text class="row_con" wx:if="{{item.sevice_status == 3}}">漏水故障</text>
|
||||||
|
<text class="row_con" wx:if="{{item.sevice_status == 3}}">主板故障</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="row2">
|
||||||
|
<view class="deletes" bind:tap="deleteItem" data-idx="{{index}}">删除</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view> -->
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="contralList">
|
||||||
|
<view class="contralBtn2" bind:tap="cancels">取消</view>
|
||||||
|
<view class="contralBtn1" bind:tap="allocation">分配</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<van-popup show="{{ show }}" bind:close="onClose" position="bottom">
|
||||||
|
<van-picker value-key="deal_name" bind:cancel="onClose" bind:confirm="onConfirm" show-toolbar columns="{{ columns }}" bind:change="onChange" />
|
||||||
|
</van-popup>
|
||||||
|
</view>
|
||||||
172
packages/partner/pages/distributor/distributor.wxss
Normal file
172
packages/partner/pages/distributor/distributor.wxss
Normal file
@ -0,0 +1,172 @@
|
|||||||
|
.iptBox {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 30rpx;
|
||||||
|
padding-bottom: 10rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-size: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.iptBox span{
|
||||||
|
margin-right: 10rpx;
|
||||||
|
}
|
||||||
|
.searchBox{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding-left: 40rpx;
|
||||||
|
}
|
||||||
|
.searchBox image{
|
||||||
|
width: 30rpx;
|
||||||
|
height: 30rpx;
|
||||||
|
}
|
||||||
|
.btns {
|
||||||
|
width: 650rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
background: #2583FF;
|
||||||
|
border-radius: 100rpx 100rpx 100rpx 100rpx;
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.choseJXS {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 30rpx;
|
||||||
|
padding-bottom: 10rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-size: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.choseJXS .label {
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
width: 180rpx;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.choseJXS2 {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 30rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-size: 30rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.choseJXS2 .label {
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
width: 180rpx;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
.iptBox .label {
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
width: 180rpx;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deviceItem {
|
||||||
|
padding: 30rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row2 {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
justify-content: flex-end;
|
||||||
|
padding-top: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deletes {
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #F56C6C;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contralList {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 0 60rpx;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 32rpx;
|
||||||
|
left: 32rpx;
|
||||||
|
right: 32rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contralBtn1 {
|
||||||
|
width: 48%;
|
||||||
|
height: 80rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
background: #2583FF;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contralBtn2 {
|
||||||
|
width: 48%;
|
||||||
|
height: 80rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
background: #F56C6C;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.deviceList {
|
||||||
|
padding: 0 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deviceList_tit {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
font-size: 30rpx;
|
||||||
|
padding-bottom: 10rpx;
|
||||||
|
border-bottom: 1rpx solid #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deviceList_item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
font-size: 30rpx;
|
||||||
|
padding: 10rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dele {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deviceList_tit_item {
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deviceList_item_con {
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
195
packages/partner/pages/editAdmin/editAdmin.js
Normal file
195
packages/partner/pages/editAdmin/editAdmin.js
Normal file
@ -0,0 +1,195 @@
|
|||||||
|
import { areaList } from '../../data/index';
|
||||||
|
|
||||||
|
let util = require('../../../../utils/util')
|
||||||
|
let apiArr = require('../../../../api/partner')
|
||||||
|
|
||||||
|
// packages/master/masterInfo/index.js
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
areaList,
|
||||||
|
Info: {},
|
||||||
|
sexOptions: ['男', '女'],
|
||||||
|
sexIndex: "",
|
||||||
|
avatarUrl: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/person/Group_309.png?2",
|
||||||
|
avatarUrl2: "",
|
||||||
|
fileList: [],
|
||||||
|
show: "",
|
||||||
|
},
|
||||||
|
// 选择头像
|
||||||
|
chooseAvatar() {
|
||||||
|
let that = this
|
||||||
|
wx.chooseMedia({
|
||||||
|
count: 1,
|
||||||
|
mediaType: ['image'],
|
||||||
|
sourceType: ['album', 'camera'],
|
||||||
|
success: (res) => {
|
||||||
|
const tempFilePath = res.tempFiles[0].tempFilePath;
|
||||||
|
// 这里可以添加上传头像到服务器的逻辑
|
||||||
|
util.uploadFileUrl(tempFilePath, (res) => {
|
||||||
|
let datas = JSON.parse(res)
|
||||||
|
console.log(datas.data);
|
||||||
|
let url = util.img_url + datas.data.path
|
||||||
|
let url2 = datas.data.path
|
||||||
|
let fileList = that.data.fileList
|
||||||
|
|
||||||
|
that.setData({
|
||||||
|
"Info.deal_img": url,
|
||||||
|
"Info.deal_icon": url2
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
changeLegal(e) {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
"Info.legal": e.detail.value
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeDealName(e) {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
"Info.deal_name": e.detail.value
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changePhone(e) {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
"Info.phone": e.detail.value
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeCustomerPhone(e) {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
"Info.customer_phone": e.detail.value
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeAddress(e){
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
"Info.address": e.detail.value
|
||||||
|
})
|
||||||
|
},
|
||||||
|
choseRegion() {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
show: true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeAddress(e){
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
"Info.address": e.detail.value
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onClose() {
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
show: false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
AreaConfirm(e){
|
||||||
|
let that = this
|
||||||
|
let region
|
||||||
|
if(e.detail.values[0].name == e.detail.values[1].name){
|
||||||
|
region = e.detail.values[0].name + e.detail.values[2].name
|
||||||
|
}else{
|
||||||
|
region = e.detail.values[0].name + e.detail.values[1].name + e.detail.values[2].name
|
||||||
|
}
|
||||||
|
that.setData({
|
||||||
|
"Info.region":region,
|
||||||
|
show:false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
getAdminInfo() {
|
||||||
|
let that = this
|
||||||
|
util.postUrl4(apiArr.getPartner, { deal_id: wx.getStorageSync('admin').shop_id }, res => {
|
||||||
|
console.log(res);
|
||||||
|
res.deal_icon = res.deal_icon.startsWith('http') ? res.deal_icon : util.img_url + res.deal_icon
|
||||||
|
that.setData({
|
||||||
|
Info: res
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
saveMasterInfo(){
|
||||||
|
let that = this
|
||||||
|
wx.showLoading({
|
||||||
|
title: '修改中...',
|
||||||
|
})
|
||||||
|
util.postUrl4(apiArr.editPartner,that.data.Info,res=>{
|
||||||
|
wx.hideLoading()
|
||||||
|
wx.showToast({
|
||||||
|
title: '修改成功',
|
||||||
|
icon:"none"
|
||||||
|
})
|
||||||
|
that.getAdminInfo()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
exit(){
|
||||||
|
wx.removeStorageSync('atoken')
|
||||||
|
wx.removeStorageSync('admin')
|
||||||
|
wx.reLaunch({
|
||||||
|
url: '/pages/newLogin/newLogin',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
this.getAdminInfo()
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
let that = this
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
3
packages/partner/pages/editAdmin/editAdmin.json
Normal file
3
packages/partner/pages/editAdmin/editAdmin.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user