处理待办事项
This commit is contained in:
17
api/index.ts
17
api/index.ts
@@ -91,3 +91,20 @@ export function fetchTodoList(data : {}) {
|
|||||||
method: 'POST'
|
method: 'POST'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 编辑待办
|
||||||
|
export function fetchEditTodo(data : {}) {
|
||||||
|
return request({
|
||||||
|
url: '/index/editTodo',
|
||||||
|
data: data,
|
||||||
|
method: 'POST'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 编辑待办
|
||||||
|
export function fetchAddTodo(data : {}) {
|
||||||
|
return request({
|
||||||
|
url: '/index/addTodo',
|
||||||
|
data: data,
|
||||||
|
method: 'POST'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
12
pages.json
12
pages.json
@@ -50,11 +50,17 @@
|
|||||||
{
|
{
|
||||||
"path": "pages/todo/todoList",
|
"path": "pages/todo/todoList",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "待办",
|
"navigationBarTitleText": "待办事项",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/todo/todoAdd",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "添加待办事项",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/index/orderAdd",
|
"path": "pages/index/orderAdd",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -147,7 +153,7 @@
|
|||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "订单详情"
|
"navigationBarTitleText": "订单详情"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
|
|
||||||
// {
|
// {
|
||||||
// "path": "pages/order/preview",
|
// "path": "pages/order/preview",
|
||||||
|
|||||||
@@ -1,413 +0,0 @@
|
|||||||
<template>
|
|
||||||
|
|
||||||
<view class="page-content">
|
|
||||||
<view style=" padding: 20rpx;">
|
|
||||||
<nut-form>
|
|
||||||
<nut-form-item label="名称">
|
|
||||||
<nut-input v-model="form.goods_name" class="nut-input-text" placeholder="请输入名称" type="text" />
|
|
||||||
</nut-form-item>
|
|
||||||
|
|
||||||
<nut-form-item label="串号">
|
|
||||||
<nut-input v-model="form.goods_no" class="nut-input-text" placeholder="请输入串号" type="text">
|
|
||||||
<template #right>
|
|
||||||
<nut-icon @click="onScan" name="scan2" size="30" custom-color="#000000" />
|
|
||||||
</template>
|
|
||||||
</nut-input>
|
|
||||||
</nut-form-item>
|
|
||||||
|
|
||||||
<nut-form-item label="售价">
|
|
||||||
<nut-input v-model="form.goods_price" class="nut-input-text" placeholder="请输入售价" type="nubmer" />
|
|
||||||
</nut-form-item>
|
|
||||||
|
|
||||||
|
|
||||||
<nut-form-item label="说明">
|
|
||||||
<nut-textarea v-model="form.content" autosize placeholder="请输入说明" type="text" />
|
|
||||||
</nut-form-item>
|
|
||||||
|
|
||||||
<nut-form-item label="介绍">
|
|
||||||
<nut-textarea v-model="form.details_content" autosize placeholder="请输入介绍" type="text" />
|
|
||||||
</nut-form-item>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <nut-form-item label="上架人">
|
|
||||||
<nut-input v-model="form.add_person" class="nut-input-text" placeholder="请输入上架人" type="text" />
|
|
||||||
</nut-form-item> -->
|
|
||||||
<!-- <nut-form-item label="排序">
|
|
||||||
<nut-input v-model="form.goods_sort" class="nut-input-text" placeholder="请输入排序" type="number" />
|
|
||||||
</nut-form-item> -->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<nut-form-item label="状态">
|
|
||||||
<nut-radio-group direction="horizontal" v-model="form.status">
|
|
||||||
<nut-radio label="10">下架</nut-radio>
|
|
||||||
<nut-radio label="20">上架</nut-radio>
|
|
||||||
</nut-radio-group>
|
|
||||||
</nut-form-item>
|
|
||||||
|
|
||||||
<nut-form-item>
|
|
||||||
<template v-slot:label>成色</template>
|
|
||||||
<template v-slot:default>
|
|
||||||
<view style="color: black;" @click="show_degree_popup = true">
|
|
||||||
<text>{{form.degree_name}}</text>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
</nut-form-item>
|
|
||||||
|
|
||||||
|
|
||||||
<nut-form-item>
|
|
||||||
<template v-slot:label>机型</template>
|
|
||||||
<template v-slot:default>
|
|
||||||
<view style="color: black;" @click="show_product_cascader = true">
|
|
||||||
<text>{{form.type_name}},{{form.brand_name}},{{form.product_name}}</text>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
</nut-form-item>
|
|
||||||
|
|
||||||
<nut-form-item>
|
|
||||||
<template v-slot:label>商品图片</template>
|
|
||||||
<template v-slot:default>
|
|
||||||
<shmily-drag-image v-model="form.images" :number=9 :add-image="addGoodsImg"
|
|
||||||
keyName="file_path"></shmily-drag-image></template>
|
|
||||||
</nut-form-item>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <nut-form-item>
|
|
||||||
<template v-slot:label>商品视频</template>
|
|
||||||
<template v-slot:default>
|
|
||||||
<nut-uploader :url="uploadVideoUrl" name="iFile" v-model:file-list="uploadVideoList"
|
|
||||||
:source-type="['album','camera']" :media-type="['video']" maximum="1" :multiple="false"
|
|
||||||
@success="onUploadSuccess" @fail="onUploadFail" @delete="onDeleteFile" :timeout="1000*60">
|
|
||||||
</nut-uploader>
|
|
||||||
</template>
|
|
||||||
</nut-form-item> -->
|
|
||||||
|
|
||||||
|
|
||||||
<view style="align-items: center;text-align: center; padding: 20rpx 60rpx;">
|
|
||||||
<nut-button type="primary" block @click="onSubmit">
|
|
||||||
新增商品
|
|
||||||
</nut-button>
|
|
||||||
</view>
|
|
||||||
</nut-form>
|
|
||||||
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<nut-popup v-model:visible="show_degree_popup" position="bottom" safe-area-inset-bottom>
|
|
||||||
<nut-picker v-model="popup_degree_val" :columns="filter_params.degree_list"
|
|
||||||
:field-names="{text:'degree_name',value:'degree_id'}" title="选择成色" @confirm="onConfirmDegree"
|
|
||||||
@cancel="show_degree_popup = false">
|
|
||||||
</nut-picker>
|
|
||||||
</nut-popup>
|
|
||||||
|
|
||||||
<nut-cascader title="机型选择" v-model:visible="show_product_cascader" v-model="cascader_product_val"
|
|
||||||
@change="onProductChange" @pathChange="onProcutPathChange" text-key="label" value-key="value"
|
|
||||||
:title-ellipsis="false" children-key="children" :options="filter_params.drop_down_options"></nut-cascader>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import {
|
|
||||||
onMounted,
|
|
||||||
reactive,
|
|
||||||
ref,
|
|
||||||
toValue
|
|
||||||
} from 'vue';
|
|
||||||
import {
|
|
||||||
fetchFilterParmas,
|
|
||||||
fetchGoodsAdd,
|
|
||||||
} from '@/api/goods';
|
|
||||||
import {
|
|
||||||
getUploadImageUrl,
|
|
||||||
} from '@/api/request';
|
|
||||||
|
|
||||||
|
|
||||||
// import {
|
|
||||||
// fetchControlAddGoods,
|
|
||||||
// } from '@/api/control';
|
|
||||||
|
|
||||||
|
|
||||||
// const uploadVideoUrl = ref('')
|
|
||||||
// uploadVideoUrl.value = getUploadVideoUrl()
|
|
||||||
// const uploadVideoOk = ref('https://qnxsd.19year.cn/wechat_2025-08-12_130250_716.png')
|
|
||||||
// const uploadVideoList = ref([])
|
|
||||||
// const videoUrl = ref('')
|
|
||||||
|
|
||||||
// const onUploadSuccess = (res) => {
|
|
||||||
// uploadVideoList.value[0].url = uploadVideoOk
|
|
||||||
// let respStr = res.data.data
|
|
||||||
// let resp = JSON.parse(respStr)
|
|
||||||
// if (resp.code === 1) {
|
|
||||||
// form.video_url = resp.data.url
|
|
||||||
// uni.showToast({
|
|
||||||
// title: '上传成功',
|
|
||||||
// icon: 'success'
|
|
||||||
// })
|
|
||||||
// } else {
|
|
||||||
// uni.showToast({
|
|
||||||
// title: '上传失败',
|
|
||||||
// icon: 'none'
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// const onDeleteFile = (files, fileList, index) => {
|
|
||||||
// uploadVideoList.value = []
|
|
||||||
// form.video_url = ""
|
|
||||||
// console.log('uploadVideoList3', uploadVideoList)
|
|
||||||
// console.log('form3', form)
|
|
||||||
// }
|
|
||||||
// const onUploadFail = (err) => {
|
|
||||||
// console.error('上传失败:', err)
|
|
||||||
// uni.showToast({
|
|
||||||
// title: '上传失败',
|
|
||||||
// icon: 'none'
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 扫码
|
|
||||||
const onScan = () => {
|
|
||||||
uni.scanCode({
|
|
||||||
onlyFromCamera: true,
|
|
||||||
success: (res) => {
|
|
||||||
console.log(res);
|
|
||||||
form.goods_no = res.result
|
|
||||||
},
|
|
||||||
fail: () => {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '扫码失败'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const filter_params = reactive({})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// const report_tags = reactive([])
|
|
||||||
|
|
||||||
// const all_report_tag_ids = ref([])
|
|
||||||
|
|
||||||
// 默认展开
|
|
||||||
// const defaultExpandKeys = ref([0])
|
|
||||||
|
|
||||||
// 显示机型选择
|
|
||||||
const show_product_cascader = ref(false)
|
|
||||||
// 显示成色
|
|
||||||
const show_degree_popup = ref(false)
|
|
||||||
|
|
||||||
// const show_disk_popup = ref(false)
|
|
||||||
// 显示验机报告
|
|
||||||
// const show_report_tags_popup = ref(false)
|
|
||||||
|
|
||||||
|
|
||||||
const popup_degree_val = ref([])
|
|
||||||
const cascader_product_val = ref([])
|
|
||||||
|
|
||||||
// const popup_disk_val = ref(["未选择"])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const form = reactive({
|
|
||||||
// goods_id: 0,
|
|
||||||
goods_name: '',
|
|
||||||
goods_no: '',
|
|
||||||
|
|
||||||
|
|
||||||
goods_price: '',
|
|
||||||
goods_stock: '',
|
|
||||||
content: '',
|
|
||||||
details_content: '',
|
|
||||||
status: '10',
|
|
||||||
images: [],
|
|
||||||
add_person: '',
|
|
||||||
|
|
||||||
// disk: '未选择',
|
|
||||||
|
|
||||||
degree_id: 0,
|
|
||||||
degree_name: '未选择',
|
|
||||||
type_id: 0,
|
|
||||||
type_name: '未选择',
|
|
||||||
brand_id: 0,
|
|
||||||
brand_name: '未选择',
|
|
||||||
product_id: 0,
|
|
||||||
product_name: '未选择',
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// video_url: ''
|
|
||||||
|
|
||||||
|
|
||||||
// goods_no: '',
|
|
||||||
|
|
||||||
|
|
||||||
// goods_status: '10',
|
|
||||||
// goods_sort: 0,
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const onProductChange = (...args) => {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const onSubmit = () => {
|
|
||||||
console.log('form====>', form);
|
|
||||||
fetchGoodsAdd(form).then(res => {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '新增商品成功'
|
|
||||||
})
|
|
||||||
// setTimeout(() => {
|
|
||||||
// uni.switchTab({
|
|
||||||
// url: '/pages/mine/index'
|
|
||||||
// });
|
|
||||||
// }, 500)
|
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
// uni.switchTab({
|
|
||||||
// url: '/pages/mine/index'
|
|
||||||
// });
|
|
||||||
uni.navigateBack({
|
|
||||||
delta: 1 // 返回上一页
|
|
||||||
});
|
|
||||||
}, 500)
|
|
||||||
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 选择机型
|
|
||||||
const onProcutPathChange = (args) => {
|
|
||||||
console.log(args);
|
|
||||||
form.type_id = 0
|
|
||||||
form.type_name = ''
|
|
||||||
form.brand_id = 0
|
|
||||||
form.brand_name = ''
|
|
||||||
form.product_id = 0
|
|
||||||
form.product_name = ''
|
|
||||||
if (args.length >= 1 && args[0] !== null) {
|
|
||||||
form.type_id = args[0].value
|
|
||||||
form.type_name = args[0].text
|
|
||||||
}
|
|
||||||
if (args.length >= 2 && args[1] !== null) {
|
|
||||||
form.brand_id = args[1].value
|
|
||||||
form.brand_name = args[1].text
|
|
||||||
}
|
|
||||||
if (args.length >= 3 && args[2] !== null) {
|
|
||||||
form.product_id = args[2].value
|
|
||||||
form.product_name = args[2].text
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 选择成色
|
|
||||||
const onConfirmDegree = () => {
|
|
||||||
form.degree_id = popup_degree_val.value[0]
|
|
||||||
filter_params.degree_list.forEach(item => {
|
|
||||||
if (item.degree_id === form.degree_id) {
|
|
||||||
form.degree_name = item.degree_name
|
|
||||||
}
|
|
||||||
})
|
|
||||||
show_degree_popup.value = false
|
|
||||||
}
|
|
||||||
// const onConfirmDisk = () => {
|
|
||||||
// form.disk = popup_disk_val.value[0]
|
|
||||||
// console.log('form.disk', form.disk);
|
|
||||||
// console.log('popup_disk_val.value', popup_disk_val.value);
|
|
||||||
// // filter_params.disk_list.forEach(item => {
|
|
||||||
// // if (item.value === form.disk) {
|
|
||||||
// // form.disk = item.value
|
|
||||||
// // }
|
|
||||||
// // })
|
|
||||||
// show_disk_popup.value = false
|
|
||||||
// }
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
fetchFilterParmas(1).then(res => {
|
|
||||||
Object.assign(filter_params, res)
|
|
||||||
filter_params.degree_list.unshift({
|
|
||||||
degree_id: 0,
|
|
||||||
degree_name: '未选择'
|
|
||||||
})
|
|
||||||
console.log('filter_params', filter_params)
|
|
||||||
// console.log('filter_params.disk_list', filter_params.disk_list)
|
|
||||||
|
|
||||||
|
|
||||||
// filter_params.disk_list.unshift({
|
|
||||||
// // id: 0,
|
|
||||||
// value: '未选择'
|
|
||||||
// })
|
|
||||||
|
|
||||||
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
// 上传商品图片
|
|
||||||
const addGoodsImg = () => {
|
|
||||||
uni.chooseImage({
|
|
||||||
count: 9 - (form.image?.length || 0),
|
|
||||||
sourceType: ['album', 'camera'],
|
|
||||||
success: res => {
|
|
||||||
res.tempFiles.forEach(file => {
|
|
||||||
uni.uploadFile({
|
|
||||||
url: getUploadImageUrl(),
|
|
||||||
filePath: file.path,
|
|
||||||
name: 'iFile',
|
|
||||||
formData: {
|
|
||||||
group_id: 1,
|
|
||||||
},
|
|
||||||
success: (res) => {
|
|
||||||
let data = JSON.parse(res.data).data
|
|
||||||
form.images.push({
|
|
||||||
id: parseInt(data.file_id),
|
|
||||||
file_path: data.file_path,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.page-content {
|
|
||||||
min-height: 100vh;
|
|
||||||
background-color: #f2f3f5;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.list {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
flex-direction: column;
|
|
||||||
background: #ffffff;
|
|
||||||
align-items: center;
|
|
||||||
max-height: 300rpx;
|
|
||||||
overflow-y: scroll;
|
|
||||||
padding: 10px;
|
|
||||||
|
|
||||||
.list-item {
|
|
||||||
border-bottom: 1px solid #eee;
|
|
||||||
padding: 20rpx 10rpx;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,341 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="content">
|
|
||||||
|
|
||||||
|
|
||||||
<nut-watermark v-if="detail.status?.value === 10" class="mark1" :z-index="1" content="此商品已下架"></nut-watermark>
|
|
||||||
<nut-watermark v-if="detail.status?.value === 30" class="mark1" :z-index="1" content="此商品已锁定"></nut-watermark>
|
|
||||||
<nut-watermark v-if="detail.status?.value === 40" class="mark1" :z-index="1" content="此商品已售出"></nut-watermark>
|
|
||||||
|
|
||||||
|
|
||||||
<swiper class="swiper" circular indicator-dots autoplay>
|
|
||||||
<swiper-item @click="showGoodsImages(idx)" v-for="(item,idx) in detail.image" :key="idx">
|
|
||||||
<image :src="item.file_path" mode="aspectFill"></image>
|
|
||||||
</swiper-item>
|
|
||||||
</swiper>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<view class='goods_info'>
|
|
||||||
<nut-cell-group>
|
|
||||||
<view class="price">
|
|
||||||
<text class="unit">¥</text>
|
|
||||||
<text class="value">{{detail.goods_price}}</text>
|
|
||||||
</view>
|
|
||||||
</nut-cell-group>
|
|
||||||
<nut-cell-group>
|
|
||||||
<view class="name">
|
|
||||||
<view class="top">
|
|
||||||
<view class="tag">
|
|
||||||
<text>{{detail.degree?.degree_name}}</text>
|
|
||||||
</view>
|
|
||||||
<text class="title">{{detail.goods_name}}</text>
|
|
||||||
</view>
|
|
||||||
<view>
|
|
||||||
<text class="info">{{detail.content}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</nut-cell-group>
|
|
||||||
<view class="service">
|
|
||||||
<view class="info">
|
|
||||||
<text class="title">服务</text>
|
|
||||||
<text class="value">{{serviceTxt}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import {
|
|
||||||
reactive,
|
|
||||||
ref
|
|
||||||
} from 'vue';
|
|
||||||
import {
|
|
||||||
navigateTo,
|
|
||||||
switchTab,
|
|
||||||
goToLoginPage
|
|
||||||
} from '@/utils/helper';
|
|
||||||
import {
|
|
||||||
onShareAppMessage,
|
|
||||||
onShareTimeline,
|
|
||||||
onLoad
|
|
||||||
} from '@dcloudio/uni-app'
|
|
||||||
import {
|
|
||||||
fetchGoodsDetail,
|
|
||||||
} from '@/api/goods';
|
|
||||||
|
|
||||||
|
|
||||||
import {
|
|
||||||
fetchGetConfig,
|
|
||||||
} from '@/api/config';
|
|
||||||
|
|
||||||
// 审核模式 默认开启 true
|
|
||||||
// const audit = ref(true);
|
|
||||||
const serviceTxt = ref('')
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const id = ref(0)
|
|
||||||
const detail = reactive({})
|
|
||||||
|
|
||||||
|
|
||||||
onLoad(options => {
|
|
||||||
console.log('init');
|
|
||||||
// 获取配置
|
|
||||||
getConfig()
|
|
||||||
|
|
||||||
// 获取商品详情
|
|
||||||
id.value = options.id
|
|
||||||
fetchGoodsDetail(id.value).then(res => {
|
|
||||||
Object.assign(detail, res)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 获取配置
|
|
||||||
const getConfig = () => {
|
|
||||||
fetchGetConfig().then(res => {
|
|
||||||
console.log('getConfig=====>', res)
|
|
||||||
// audit.value = res.appConfig.is_audit == 1
|
|
||||||
serviceTxt.value = res.appConfig.service_txt
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 分享给朋友圈
|
|
||||||
onShareTimeline((res) => {
|
|
||||||
return {
|
|
||||||
title: detail.goods_name,
|
|
||||||
path: '/pages/mall/detail?id=' + detail.goods_id,
|
|
||||||
imageUrl: detail.image[0].file_path
|
|
||||||
};
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
// 分享
|
|
||||||
onShareAppMessage((res) => {
|
|
||||||
return {
|
|
||||||
title: detail.goods_name,
|
|
||||||
path: '/pages/mall/detail?id=' + detail.goods_id,
|
|
||||||
imageUrl: detail.image[0].file_path
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 显示图片
|
|
||||||
const showGoodsImages = (index) => {
|
|
||||||
uni.previewImage({
|
|
||||||
current: index, // 指定当前显示的图片索引
|
|
||||||
urls: detail.image.map(e => {
|
|
||||||
return e.file_path
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.bottom-action {
|
|
||||||
position: fixed;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
height: 50px;
|
|
||||||
background: #fff;
|
|
||||||
width: calc(100% - 20px);
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
margin: 0 auto;
|
|
||||||
padding: 5px 10px;
|
|
||||||
|
|
||||||
.bottom-action-icon {
|
|
||||||
align-items: center;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
.bottom-action-icon-item {
|
|
||||||
align-items: center;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
text {
|
|
||||||
color: rgba(0, 0, 0, .5);
|
|
||||||
font-size: 11px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.bottom-action-btn {
|
|
||||||
-ms-flex-align: center;
|
|
||||||
-ms-flex-pack: end;
|
|
||||||
-webkit-align-items: center;
|
|
||||||
align-items: center;
|
|
||||||
display: -webkit-flex;
|
|
||||||
display: -ms-flexbox;
|
|
||||||
display: flex;
|
|
||||||
gap: 5px;
|
|
||||||
-webkit-justify-content: flex-end;
|
|
||||||
justify-content: flex-end;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
min-height: calc(100vh - 50px); //100vh;
|
|
||||||
/* align-items: center; */
|
|
||||||
// justify-content: center;
|
|
||||||
background-color: #f2f3f5;
|
|
||||||
// height: calc(100% - 50px);
|
|
||||||
--nut-cell-group-title-color: #000;
|
|
||||||
--nut-collapse-item-padding: 10px 10px 10px 10px;
|
|
||||||
--nut-collapse-wrapper-content-padding: 10px 10px 10px 10px;
|
|
||||||
--nut-collapse-item-color: #000;
|
|
||||||
padding-bottom: 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.report-inner {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 5px;
|
|
||||||
|
|
||||||
.report-item {
|
|
||||||
.report-item-name {
|
|
||||||
color: rgba(0, 0, 0, .9);
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
|
|
||||||
.report-item-content {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
|
|
||||||
.report-item-content-item {
|
|
||||||
padding-top: 2px;
|
|
||||||
padding-bottom: 2px;
|
|
||||||
width: 50%;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.count-item {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
gap: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.swiper {
|
|
||||||
width: 100%;
|
|
||||||
height: 414px;
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods_info {
|
|
||||||
padding: 5px;
|
|
||||||
color: #000;
|
|
||||||
|
|
||||||
.price {
|
|
||||||
border-radius: 5px;
|
|
||||||
padding: 10px;
|
|
||||||
background: #fff;
|
|
||||||
|
|
||||||
.unit {
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.value {
|
|
||||||
font-size: 24px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.name {
|
|
||||||
border-radius: 5px;
|
|
||||||
padding: 10px;
|
|
||||||
background: #fff;
|
|
||||||
|
|
||||||
display: flex;
|
|
||||||
gap: 5px;
|
|
||||||
flex-direction: column;
|
|
||||||
|
|
||||||
.top {
|
|
||||||
display: flex;
|
|
||||||
gap: 5px;
|
|
||||||
|
|
||||||
.tag {
|
|
||||||
background: #000;
|
|
||||||
padding: 1px 2px;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
display: flex;
|
|
||||||
border-radius: 2px;
|
|
||||||
|
|
||||||
text {
|
|
||||||
font-size: 10px;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.info {
|
|
||||||
color: rgba(0, 0, 0, .7);
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.service {
|
|
||||||
border-radius: 5px;
|
|
||||||
padding: 10px;
|
|
||||||
background: #fff;
|
|
||||||
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
.info {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
gap: 5px;
|
|
||||||
|
|
||||||
.title {
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.value {
|
|
||||||
color: rgba(0, 0, 0, .7);
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.right_icon {
|
|
||||||
background-color: currentColor;
|
|
||||||
mask: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiPjxwYXRoIGZpbGw9IiMxQTFBMUEiIGQ9Ik0zNTMuODMgMTU4LjE3YTQyLjY3IDQyLjY3IDAgMSAxIDYwLjM0LTYwLjM0bDM4NCAzODRhNDIuNjcgNDIuNjcgMCAwIDEgMCA2MC4zNmwtMzg0IDM4NGE0Mi42NyA0Mi42NyAwIDEgMS02MC4zNC02MC4zNkw3MDcuNjcgNTEyeiIvPjwvc3ZnPg==') 0 0/100% 100% no-repeat;
|
|
||||||
width: 12px;
|
|
||||||
height: 12px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.report {
|
|
||||||
border-radius: 5px;
|
|
||||||
padding: 1px;
|
|
||||||
background: #fff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,339 +0,0 @@
|
|||||||
<template>
|
|
||||||
|
|
||||||
<view class="page-content">
|
|
||||||
|
|
||||||
<view v-if="is_show_edit" style=" padding: 20rpx;">
|
|
||||||
|
|
||||||
|
|
||||||
<nut-form>
|
|
||||||
<nut-form-item label="名称">
|
|
||||||
<nut-input v-model="form.goods_name" class="nut-input-text" placeholder="请输入名称" type="text" />
|
|
||||||
</nut-form-item>
|
|
||||||
|
|
||||||
<nut-form-item label="串号">
|
|
||||||
<nut-input v-model="form.goods_no" class="nut-input-text" placeholder="请输入串号" type="text">
|
|
||||||
<template #right>
|
|
||||||
<nut-icon @click="onScan" name="scan2" size="30" custom-color="#000000" />
|
|
||||||
</template>
|
|
||||||
</nut-input>
|
|
||||||
</nut-form-item>
|
|
||||||
|
|
||||||
<nut-form-item label="售价">
|
|
||||||
<nut-input v-model="form.goods_price" class="nut-input-text" placeholder="请输入售价" type="nubmer" />
|
|
||||||
</nut-form-item>
|
|
||||||
|
|
||||||
|
|
||||||
<nut-form-item label="说明">
|
|
||||||
<nut-textarea v-model="form.content" autosize placeholder="请输入说明" type="text" />
|
|
||||||
</nut-form-item>
|
|
||||||
|
|
||||||
<nut-form-item label="介绍">
|
|
||||||
<nut-textarea v-model="form.details_content" autosize placeholder="请输入介绍" type="text" />
|
|
||||||
</nut-form-item>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <nut-form-item label="上架人">
|
|
||||||
<nut-input v-model="form.add_person" class="nut-input-text" placeholder="请输入上架人" type="text" />
|
|
||||||
</nut-form-item> -->
|
|
||||||
<!-- <nut-form-item label="排序">
|
|
||||||
<nut-input v-model="form.goods_sort" class="nut-input-text" placeholder="请输入排序" type="number" />
|
|
||||||
</nut-form-item> -->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<nut-form-item label="状态">
|
|
||||||
<nut-radio-group direction="horizontal" v-model="form.status">
|
|
||||||
<nut-radio label="10">下架</nut-radio>
|
|
||||||
<nut-radio label="20">上架</nut-radio>
|
|
||||||
</nut-radio-group>
|
|
||||||
</nut-form-item>
|
|
||||||
|
|
||||||
<nut-form-item>
|
|
||||||
<template v-slot:label>成色</template>
|
|
||||||
<template v-slot:default>
|
|
||||||
<view style="color: black;" @click="show_degree_popup = true">
|
|
||||||
<text>{{form.degree_name}}</text>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
</nut-form-item>
|
|
||||||
|
|
||||||
|
|
||||||
<nut-form-item>
|
|
||||||
<template v-slot:label>机型</template>
|
|
||||||
<template v-slot:default>
|
|
||||||
<view style="color: black;" @click="show_product_cascader = true">
|
|
||||||
<text>{{form.type_name}},{{form.brand_name}},{{form.product_name}}</text>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
</nut-form-item>
|
|
||||||
|
|
||||||
<nut-form-item>
|
|
||||||
<template v-slot:label>商品图片</template>
|
|
||||||
<template v-slot:default>
|
|
||||||
<shmily-drag-image v-model="form.images" :number=9 :add-image="addGoodsImg"
|
|
||||||
keyName="file_path"></shmily-drag-image></template>
|
|
||||||
</nut-form-item>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<view style="align-items: center;text-align: center; padding: 20rpx 60rpx;">
|
|
||||||
<nut-button type="primary" block @click="onSubmit">
|
|
||||||
保存修改
|
|
||||||
</nut-button>
|
|
||||||
</view>
|
|
||||||
</nut-form>
|
|
||||||
|
|
||||||
</view>
|
|
||||||
|
|
||||||
|
|
||||||
<nut-popup v-model:visible="show_degree_popup" position="bottom" safe-area-inset-bottom>
|
|
||||||
<nut-picker v-model="popup_degree_val" :columns="filter_params.degree_list"
|
|
||||||
:field-names="{text:'degree_name',value:'degree_id'}" title="选择成色" @confirm="onConfirmDegree"
|
|
||||||
@cancel="show_degree_popup = false">
|
|
||||||
</nut-picker>
|
|
||||||
</nut-popup>
|
|
||||||
|
|
||||||
<nut-cascader title="机型选择" v-model:visible="show_product_cascader" v-model="cascader_product_val"
|
|
||||||
@change="onProductChange" @pathChange="onProcutPathChange" text-key="label" value-key="value"
|
|
||||||
:title-ellipsis="false" children-key="children" :options="filter_params.drop_down_options"></nut-cascader>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import {
|
|
||||||
onMounted,
|
|
||||||
reactive,
|
|
||||||
ref,
|
|
||||||
toValue,
|
|
||||||
computed
|
|
||||||
} from 'vue';
|
|
||||||
import {
|
|
||||||
onLoad
|
|
||||||
} from '@dcloudio/uni-app'
|
|
||||||
|
|
||||||
|
|
||||||
import {
|
|
||||||
fetchFilterParmas,
|
|
||||||
fetchGoodsEdit,
|
|
||||||
fetchGoodsDetail,
|
|
||||||
} from '@/api/goods';
|
|
||||||
import {
|
|
||||||
getUploadImageUrl,
|
|
||||||
} from '@/api/request';
|
|
||||||
|
|
||||||
const id = ref(0)
|
|
||||||
// 是否显示结果页
|
|
||||||
const is_show_edit = ref(false);
|
|
||||||
// 显示机型选择
|
|
||||||
const show_product_cascader = ref(false)
|
|
||||||
// 显示成色
|
|
||||||
const show_degree_popup = ref(false)
|
|
||||||
const popup_degree_val = ref([])
|
|
||||||
const cascader_product_val = ref([])
|
|
||||||
const filter_params = reactive({})
|
|
||||||
const form = reactive({
|
|
||||||
goods_id: 0,
|
|
||||||
goods_name: '',
|
|
||||||
goods_no: '',
|
|
||||||
goods_price: '',
|
|
||||||
goods_stock: '',
|
|
||||||
content: '',
|
|
||||||
details_content: '',
|
|
||||||
status: '10',
|
|
||||||
images: [],
|
|
||||||
add_person: '',
|
|
||||||
degree_id: 0,
|
|
||||||
degree_name: '未选择',
|
|
||||||
type_id: 0,
|
|
||||||
type_name: '未选择',
|
|
||||||
brand_id: 0,
|
|
||||||
brand_name: '未选择',
|
|
||||||
product_id: 0,
|
|
||||||
product_name: '未选择',
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
onMounted(() => {
|
|
||||||
fetchFilterParmas(1).then(res => {
|
|
||||||
Object.assign(filter_params, res)
|
|
||||||
filter_params.degree_list.unshift({
|
|
||||||
degree_id: 0,
|
|
||||||
degree_name: '未选择'
|
|
||||||
})
|
|
||||||
console.log('filter_params', filter_params)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
onLoad(options => {
|
|
||||||
console.log("goods_id===>", options.id);
|
|
||||||
// 获取商品详情
|
|
||||||
id.value = options.id
|
|
||||||
is_show_edit.value = false;
|
|
||||||
fetchGoodsDetail(id.value).then(res => {
|
|
||||||
is_show_edit.value = true;
|
|
||||||
console.log("====>", res);
|
|
||||||
form.goods_id = res.goods_id
|
|
||||||
form.goods_name = res.goods_name
|
|
||||||
form.goods_no = res.goods_no
|
|
||||||
form.goods_price = res.goods_price
|
|
||||||
// form.goods_stock = res.goods_stock
|
|
||||||
form.content = res.content
|
|
||||||
form.details_content = res.details_content
|
|
||||||
form.status = res.status.value.toString()
|
|
||||||
|
|
||||||
form.degree_id = res.degree?.degree_id ?? 0
|
|
||||||
form.degree_name = res.degree?.degree_name ?? '未选择'
|
|
||||||
form.type_id = res.type?.type_id ?? 0
|
|
||||||
form.type_name = res.type?.name ?? '未选择'
|
|
||||||
form.brand_id = res.brand?.brand_id ?? 0
|
|
||||||
form.brand_name = res.brand?.name ?? '未选择'
|
|
||||||
form.product_id = res.product?.product_id ?? 0
|
|
||||||
form.product_name = res.product?.name ?? '未选择'
|
|
||||||
popup_degree_val.value = [res.degree?.degree_id ?? 0]
|
|
||||||
cascader_product_val.value = [res.type?.type_id ?? 0, res.brand?.brand_id ?? 0, res.product
|
|
||||||
?.product_id ?? 0
|
|
||||||
]
|
|
||||||
form.images = []
|
|
||||||
res.image?.forEach(item => {
|
|
||||||
form.images.push({
|
|
||||||
id: item.image_id,
|
|
||||||
file_path: item.file_path,
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
const onProductChange = (...args) => {
|
|
||||||
console.log(0, ...args)
|
|
||||||
console.log(cascader_product_val)
|
|
||||||
}
|
|
||||||
|
|
||||||
const onSubmit = () => {
|
|
||||||
console.log('form===>', form);
|
|
||||||
fetchGoodsEdit(form).then(res => {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '编辑商品成功'
|
|
||||||
})
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.navigateBack({
|
|
||||||
delta: 1 // 返回上一页
|
|
||||||
});
|
|
||||||
}, 500)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 扫码
|
|
||||||
const onScan = () => {
|
|
||||||
uni.scanCode({
|
|
||||||
onlyFromCamera: true,
|
|
||||||
success: (res) => {
|
|
||||||
console.log(res);
|
|
||||||
form.goods_no = res.result
|
|
||||||
},
|
|
||||||
fail: () => {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '扫码失败'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const onProcutPathChange = (args) => {
|
|
||||||
console.log(args);
|
|
||||||
form.type_id = 0
|
|
||||||
form.type_name = ''
|
|
||||||
form.brand_id = 0
|
|
||||||
form.brand_name = ''
|
|
||||||
form.product_id = 0
|
|
||||||
form.product_name = ''
|
|
||||||
if (args.length >= 1 && args[0] !== null) {
|
|
||||||
form.type_id = args[0].value
|
|
||||||
form.type_name = args[0].text
|
|
||||||
}
|
|
||||||
if (args.length >= 2 && args[1] !== null) {
|
|
||||||
form.brand_id = args[1].value
|
|
||||||
form.brand_name = args[1].text
|
|
||||||
}
|
|
||||||
if (args.length >= 3 && args[2] !== null) {
|
|
||||||
form.product_id = args[2].value
|
|
||||||
form.product_name = args[2].text
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const onConfirmDegree = () => {
|
|
||||||
form.degree_id = popup_degree_val.value[0]
|
|
||||||
filter_params.degree_list.forEach(item => {
|
|
||||||
if (item.degree_id === form.degree_id) {
|
|
||||||
form.degree_name = item.degree_name
|
|
||||||
}
|
|
||||||
})
|
|
||||||
show_degree_popup.value = false
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 上传商品图片
|
|
||||||
const addGoodsImg = () => {
|
|
||||||
uni.chooseImage({
|
|
||||||
count: 9 - (form.image?.length || 0),
|
|
||||||
sourceType: ['album', 'camera'],
|
|
||||||
success: res => {
|
|
||||||
res.tempFiles.forEach(file => {
|
|
||||||
uni.uploadFile({
|
|
||||||
url: getUploadImageUrl(),
|
|
||||||
filePath: file.path,
|
|
||||||
name: 'iFile',
|
|
||||||
formData: {
|
|
||||||
group_id: 1,
|
|
||||||
},
|
|
||||||
success: (res) => {
|
|
||||||
let data = JSON.parse(res.data).data
|
|
||||||
form.images.push({
|
|
||||||
id: parseInt(data.file_id),
|
|
||||||
file_path: data.file_path,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.page-content {
|
|
||||||
min-height: 100vh;
|
|
||||||
background-color: #f2f3f5;
|
|
||||||
--nut-searchbar-input-height: 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// .list {
|
|
||||||
// display: flex;
|
|
||||||
// justify-content: center;
|
|
||||||
// flex-direction: column;
|
|
||||||
// background: #ffffff;
|
|
||||||
// align-items: center;
|
|
||||||
// max-height: 300rpx;
|
|
||||||
// overflow-y: scroll;
|
|
||||||
// padding: 10px;
|
|
||||||
|
|
||||||
// .list-item {
|
|
||||||
// border-bottom: 1px solid #eee;
|
|
||||||
// padding: 20rpx 10rpx;
|
|
||||||
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
</style>
|
|
||||||
@@ -1,705 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="page-content">
|
|
||||||
<z-paging ref="paging" :refresher-enabled="false" :auto-clean-list-when-reload="false"
|
|
||||||
:auto-scroll-to-top-when-reload="false" v-model="dataList" @query="queryList">
|
|
||||||
<view style="z-index: 10000;position: sticky;" :style="'top:0px'">
|
|
||||||
<view class="top-bar">
|
|
||||||
<nut-button type="primary" block plain @click="navigateTo('/pages/config/goodsAdd')">
|
|
||||||
新增订单
|
|
||||||
</nut-button>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="goods-item" v-for="(item, index) in dataList" :key="index">
|
|
||||||
<view class="goods-item-image">
|
|
||||||
<!-- @click="showGoodsImages(item)" -->
|
|
||||||
<image class="goods-item-image-img" :src="getImg(item)" @click="navigateTo('/pages/config/goodsDetail?id=' + item.goods_id)"
|
|
||||||
mode="scaleToFill">
|
|
||||||
</image>
|
|
||||||
</view>
|
|
||||||
<view class="goods-item-content">
|
|
||||||
<!-- @click="navigateTo('/pages/control/goods/edit?id=' + item.goods_id)" -->
|
|
||||||
<view class="goods-item-content-header">
|
|
||||||
<nut-tag custom-color="#1a1a1a">{{ item.degree.degree_name }}</nut-tag>
|
|
||||||
<view>{{item.goods_name}}</view>
|
|
||||||
</view>
|
|
||||||
<!-- @click="navigateTo('/pages/control/goods/edit?id=' + item.goods_id)" -->
|
|
||||||
<view class="goods-item-content-body">
|
|
||||||
<view class="goods-item-content-body-desc">
|
|
||||||
{{item.content}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="goods-item-content-footer">
|
|
||||||
<view style="font-size: 24rpx;color: red;">
|
|
||||||
<text>¥{{item.goods_price}}</text>
|
|
||||||
</view>
|
|
||||||
<view style="font-size: 24rpx;">
|
|
||||||
状态:<text>{{item.status.text}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="goods-item-content-footer-btn">
|
|
||||||
<nut-button size="small" type="primary"
|
|
||||||
v-if="item.status.value == 10 || item.status.value == 20"
|
|
||||||
@click="navigateTo('/pages/config/goodsEdit?id=' + item.goods_id)">
|
|
||||||
编辑商品
|
|
||||||
</nut-button>
|
|
||||||
<nut-button size="small" type="primary" v-if="item.status.value == 40 "
|
|
||||||
@click="navigateTo('/pages/config/goodsEdit?id=' + item.goods_id)">
|
|
||||||
售后(重新上架)
|
|
||||||
</nut-button>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</z-paging>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import {
|
|
||||||
ref,
|
|
||||||
reactive,
|
|
||||||
onMounted,
|
|
||||||
computed
|
|
||||||
} from 'vue'
|
|
||||||
|
|
||||||
import {
|
|
||||||
onLoad,
|
|
||||||
onShow,
|
|
||||||
} from '@dcloudio/uni-app'
|
|
||||||
// import {
|
|
||||||
|
|
||||||
// fetchFilterParmas
|
|
||||||
// } from '@/api/goods';
|
|
||||||
import {
|
|
||||||
fetchFilterParmas,
|
|
||||||
fetchSysGoodsList
|
|
||||||
} from '@/api/goods';
|
|
||||||
|
|
||||||
import {
|
|
||||||
navigateTo,
|
|
||||||
// switchTab,
|
|
||||||
// goToOtherMiniProgram
|
|
||||||
} from '@/utils/helper';
|
|
||||||
|
|
||||||
|
|
||||||
// 显示商品图片
|
|
||||||
const showGoodsImages = (goods) => {
|
|
||||||
console.log(goods);
|
|
||||||
uni.previewImage({
|
|
||||||
// current: index, // 指定当前显示的图片索引
|
|
||||||
urls: goods?.image.map(e => {
|
|
||||||
return e.file_path
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const getImg = (goods) => {
|
|
||||||
const url = goods?.image?.[0]?.file_path
|
|
||||||
return url ? url + '?imageView2/1/w/200/h/200' : ''
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// zp
|
|
||||||
const paging = ref(null);
|
|
||||||
// 商品列表
|
|
||||||
const dataList = ref([]);
|
|
||||||
|
|
||||||
// 价格排序
|
|
||||||
const selectPriceSortRef = ref(null);
|
|
||||||
// 成色选择
|
|
||||||
const selectDegreeRef = ref(null);
|
|
||||||
// 机型选择
|
|
||||||
const selectProductRef = ref(null)
|
|
||||||
|
|
||||||
const state = reactive({
|
|
||||||
type_params: [], // 产品类型
|
|
||||||
drop_down_options: [], // 产品类型下的品牌列表
|
|
||||||
o_drop_down_options: [],
|
|
||||||
// 价格排序
|
|
||||||
price_sort_params: [{
|
|
||||||
text: '默认排序',
|
|
||||||
value: ''
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '价格升序',
|
|
||||||
value: 'ascend'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '价格降序',
|
|
||||||
value: 'descend'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
// 成色所有选项
|
|
||||||
degree_params: [],
|
|
||||||
price_sort: '',
|
|
||||||
price_sort_name: "默认排序",
|
|
||||||
degree_ids: [],
|
|
||||||
degree_name: "成色",
|
|
||||||
product_name: "机型",
|
|
||||||
type_id: 1, // 产品类型id 默认 1 手机
|
|
||||||
type_name: '手机',
|
|
||||||
brand_id: 0, // 品牌id // 默认 0 全部
|
|
||||||
brand_name: '全部',
|
|
||||||
product_ids: [0], // 机型ids 默认 0 全部
|
|
||||||
search_val: '', // 搜索
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 搜索
|
|
||||||
const onSearch = () => {
|
|
||||||
console.log("搜索:", state.search_val);
|
|
||||||
paging.value.reload();
|
|
||||||
|
|
||||||
}
|
|
||||||
// 清空搜索框
|
|
||||||
const onClear = () => {
|
|
||||||
console.log("搜索:", state.search_val);
|
|
||||||
paging.value.reload();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 机型重置
|
|
||||||
const onResetProduct = () => {
|
|
||||||
console.log("重置产品");
|
|
||||||
state.type_id = 1
|
|
||||||
state.type_name = '手机'
|
|
||||||
state.brand_id = 0
|
|
||||||
state.brand_name = '全部'
|
|
||||||
state.product_ids = [0]
|
|
||||||
state.product_name = '机型'
|
|
||||||
}
|
|
||||||
// 机型确定
|
|
||||||
const onConfirmProduct = () => {
|
|
||||||
console.log("当前产品类型", {
|
|
||||||
"type_id": state.type_id,
|
|
||||||
"type_name": state.type_name,
|
|
||||||
"brand_id": state.brand_id,
|
|
||||||
"brand_name": state.brand_name,
|
|
||||||
"product_ids": state.product_ids,
|
|
||||||
});
|
|
||||||
selectProductRef.value?.toggle(false);
|
|
||||||
// 4. 刷新数据
|
|
||||||
paging.value.reload();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 选择机型
|
|
||||||
const selectProduct = (product) => {
|
|
||||||
if (product.value === 0) {
|
|
||||||
state.product_ids = [0]
|
|
||||||
} else {
|
|
||||||
state.product_ids = state.product_ids.filter(e => e != 0)
|
|
||||||
// 判断是否存在
|
|
||||||
const index = state.product_ids.indexOf(product.value);
|
|
||||||
if (index > -1) {
|
|
||||||
state.product_ids.splice(index, 1); // 存在则删除
|
|
||||||
if (state.product_ids.length === 0) {
|
|
||||||
state.product_ids = [0]
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
state.product_ids.push(product.value); // 新增
|
|
||||||
}
|
|
||||||
}
|
|
||||||
console.log(product);
|
|
||||||
}
|
|
||||||
|
|
||||||
const productOptions = computed(() => {
|
|
||||||
return state?.o_drop_down_options[state.type_id]?.children[state.brand_id].children
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
// 选择品牌
|
|
||||||
const selectBrand = (brand) => {
|
|
||||||
console.log(brand);
|
|
||||||
// 选中的品牌id
|
|
||||||
state.brand_id = brand.value;
|
|
||||||
state.brand_name = brand.label
|
|
||||||
// 品牌下的产品ids
|
|
||||||
state.product_ids = [0];
|
|
||||||
state.product_name = brand.label
|
|
||||||
}
|
|
||||||
// 选择type
|
|
||||||
const selectType = (type) => {
|
|
||||||
console.log(type);
|
|
||||||
// 选中产品类型id
|
|
||||||
state.type_id = type.type_id;
|
|
||||||
state.type_name = type.name;
|
|
||||||
// 选中的品牌id
|
|
||||||
state.brand_id = 0;
|
|
||||||
state.brand_name = '全部';
|
|
||||||
// 品牌下的产品ids
|
|
||||||
state.product_ids = [0];
|
|
||||||
}
|
|
||||||
|
|
||||||
// 选择价格排序
|
|
||||||
const selectPriceSort = (item) => {
|
|
||||||
if (state.price_sort !== item.value) {
|
|
||||||
state.price_sort = item.value
|
|
||||||
state.price_sort_name = item.text
|
|
||||||
} else {
|
|
||||||
state.price_sort_name = '默认排序'
|
|
||||||
state.price_sort = ''
|
|
||||||
}
|
|
||||||
selectPriceSortRef.value?.toggle(false);
|
|
||||||
// 4. 刷新数据
|
|
||||||
paging.value.reload();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 选择成色
|
|
||||||
const selectDegree = (item) => {
|
|
||||||
const index = state.degree_ids.indexOf(item.value);
|
|
||||||
if (index > -1) {
|
|
||||||
state.degree_ids.splice(index, 1);
|
|
||||||
} else {
|
|
||||||
state.degree_ids.push(item.value);
|
|
||||||
}
|
|
||||||
if (state.degree_ids.length > 0) {
|
|
||||||
state.degree_name = '已选' + state.degree_ids.length.toString() + '项'
|
|
||||||
} else {
|
|
||||||
state.degree_name = '成色'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 重置选择成色
|
|
||||||
const onResetDegree = () => {
|
|
||||||
state.degree_ids = [];
|
|
||||||
state.degree_name = '成色'
|
|
||||||
selectDegreeRef.value?.toggle(false);
|
|
||||||
// 4. 刷新数据
|
|
||||||
paging.value.reload();
|
|
||||||
}
|
|
||||||
// 确认选择成色
|
|
||||||
const onConfirmDegree = () => {
|
|
||||||
if (state.degree_ids.length > 0) {
|
|
||||||
state.degree_name = '已选' + state.degree_ids.length.toString() + '项'
|
|
||||||
} else {
|
|
||||||
state.degree_name = '成色'
|
|
||||||
}
|
|
||||||
selectDegreeRef.value?.toggle(false);
|
|
||||||
// 4. 刷新数据
|
|
||||||
paging.value.reload();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 获取列表
|
|
||||||
const queryList = (pageNo, pageSize) => {
|
|
||||||
const params = {
|
|
||||||
pageSize,
|
|
||||||
page: pageNo,
|
|
||||||
price_sort: state.price_sort,
|
|
||||||
degree_ids: state.degree_ids,
|
|
||||||
type_id: state.type_id,
|
|
||||||
brand_id: state.brand_id,
|
|
||||||
product_ids: state.product_ids,
|
|
||||||
search: state.search_val,
|
|
||||||
}
|
|
||||||
console.log(params);
|
|
||||||
fetchSysGoodsList(params).then(res => {
|
|
||||||
console.log('res=>', res.list);
|
|
||||||
paging.value.complete(res.list);
|
|
||||||
|
|
||||||
}).catch(res => {
|
|
||||||
paging.value.complete(false);
|
|
||||||
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const init = () => {
|
|
||||||
console.log('init111');
|
|
||||||
// 加载默认筛选项内容
|
|
||||||
fetchFilterParmas().then(res => {
|
|
||||||
console.log(res);
|
|
||||||
// 处理成色
|
|
||||||
let degree_params = res.degree_list;
|
|
||||||
state.degree_params = degree_params.reduce((it, cit) => {
|
|
||||||
it.push({
|
|
||||||
text: cit.degree_name,
|
|
||||||
value: cit.degree_id
|
|
||||||
});
|
|
||||||
return it;
|
|
||||||
}, state.degree_params) || [];
|
|
||||||
// 产品类型
|
|
||||||
state.type_params = res.type_list
|
|
||||||
// 产品下品牌列表
|
|
||||||
state.drop_down_options = res.drop_down_options
|
|
||||||
state.o_drop_down_options = res.o_drop_down_options
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
onShow(() => {
|
|
||||||
console.log("onshow---");
|
|
||||||
console.log('paging.value', paging.value);
|
|
||||||
if (paging.value) {
|
|
||||||
// paging.value.pageNo = 1;
|
|
||||||
paging.value.refresh();
|
|
||||||
// paging.value.refreshToPage(1)
|
|
||||||
// paging.value.reload();
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
onMounted(() => {
|
|
||||||
init();
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.page-content {
|
|
||||||
min-height: 100vh;
|
|
||||||
background-color: #f2f3f5;
|
|
||||||
--nut-menu-bar-box-shadow: none;
|
|
||||||
--nut-menu-item-content-padding: 20rpx;
|
|
||||||
--nut-menu-item-content-max-height: 900rpx;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// --nut-searchbar-input-padding:5px 0 5px 13px;
|
|
||||||
--nut-searchbar-input-height: 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.titleClass) .nut-menu__title-text {
|
|
||||||
font-size: 30rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
color: black;
|
|
||||||
}
|
|
||||||
|
|
||||||
.top-bar {
|
|
||||||
background: #fff;
|
|
||||||
// padding: 20rpx;
|
|
||||||
align-items: center;
|
|
||||||
text-align: center;
|
|
||||||
padding: 20rpx 60rpx;
|
|
||||||
// display: flex;
|
|
||||||
// justify-content: space-between;
|
|
||||||
// border-top: 1px solid #eee;
|
|
||||||
// position: sticky;
|
|
||||||
// bottom: 0;
|
|
||||||
// z-index: 999;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.goods-item {
|
|
||||||
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
padding: 20rpx;
|
|
||||||
background-color: #ffffff;
|
|
||||||
// border-radius: 20rpx;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
gap: 20rpx;
|
|
||||||
|
|
||||||
.goods-item-image {
|
|
||||||
width: 180rpx;
|
|
||||||
height: 180rpx;
|
|
||||||
|
|
||||||
.goods-item-image-img {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-item-content {
|
|
||||||
// width: 100%;
|
|
||||||
display: flex;
|
|
||||||
flex: 1;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: space-between;
|
|
||||||
/* 首尾贴边,中间均分 */
|
|
||||||
|
|
||||||
// gap: 15px;
|
|
||||||
.goods-item-content-header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
padding: 6rpx 0;
|
|
||||||
gap: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-item-content-body {
|
|
||||||
padding: 6rpx 0;
|
|
||||||
|
|
||||||
.goods-item-content-body-desc {
|
|
||||||
color: #7c7c7c;
|
|
||||||
font-size: 26rpx;
|
|
||||||
/* 关键属性 */
|
|
||||||
display: -webkit-box;
|
|
||||||
/* 使用弹性盒子布局 */
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
/* 垂直方向排列 */
|
|
||||||
-webkit-line-clamp: 2;
|
|
||||||
/* 限制显示两行 */
|
|
||||||
overflow: hidden;
|
|
||||||
/* 超出部分隐藏 */
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
/* 超出时显示省略号 */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-item-content-stock {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
.goods-item-content-stock-desc {
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #999999;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-item-content-status-desc {
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: red;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-item-content-footer {
|
|
||||||
padding: 6rpx 0;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
// width: 100%;
|
|
||||||
// flex-direction: row;
|
|
||||||
|
|
||||||
.goods-item-content-footer-btn {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
gap: 10rpx;
|
|
||||||
|
|
||||||
.share-btn {
|
|
||||||
border-radius: 50rpx;
|
|
||||||
border: 2rpx solid red;
|
|
||||||
font-size: 26rpx;
|
|
||||||
align-items: center;
|
|
||||||
height: 54rpx;
|
|
||||||
color: red;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.filter-types {
|
|
||||||
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-start;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
overflow: auto;
|
|
||||||
gap: 10rpx;
|
|
||||||
padding: 10rpx;
|
|
||||||
// position: fixed;
|
|
||||||
// top: 0;
|
|
||||||
height: 60rpx;
|
|
||||||
// z-index: 9999;
|
|
||||||
background-color: #fff;
|
|
||||||
border-bottom: 2rpx solid gainsboro;
|
|
||||||
border-top: 2rpx solid gainsboro;
|
|
||||||
|
|
||||||
.filter-type-inner {
|
|
||||||
align-items: center;
|
|
||||||
background-color: rgba(0, 0, 0, .05);
|
|
||||||
border-radius: 16rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
display: -webkit-flex;
|
|
||||||
display: -ms-flexbox;
|
|
||||||
display: flex;
|
|
||||||
flex: 0 0 auto;
|
|
||||||
font-size: 28rpx;
|
|
||||||
gap: 15rpx;
|
|
||||||
padding: 10rpx 20rpx;
|
|
||||||
|
|
||||||
// image {
|
|
||||||
// height: 22px;
|
|
||||||
// width: 22px;
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
.filter-type-inner.active {
|
|
||||||
background-color: rgba(250, 44, 25, .1);
|
|
||||||
color: var(--nutui-color-primary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.tabs-container {
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
.tab-pane-inner {
|
|
||||||
height: 600rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tabs-inner {
|
|
||||||
overflow-y: scroll;
|
|
||||||
height: 600rpx;
|
|
||||||
width: 160rpx;
|
|
||||||
background-color: #F5F5F5;
|
|
||||||
|
|
||||||
.tab-inner {
|
|
||||||
display: flex;
|
|
||||||
height: 60rpx;
|
|
||||||
padding: 10rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
background: #F5F5F5;
|
|
||||||
|
|
||||||
text {
|
|
||||||
width: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.tab-inner-active {
|
|
||||||
// background: #FFF;
|
|
||||||
background-color: rgba(250, 44, 25, .1);
|
|
||||||
color: var(--nutui-color-primary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.degree-inner {
|
|
||||||
display: flex;
|
|
||||||
flex: 1;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
// gap: 20rpx;
|
|
||||||
gap: 10rpx;
|
|
||||||
// padding: 11px;
|
|
||||||
width: 100%;
|
|
||||||
margin-bottom: 60rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.degree-item {
|
|
||||||
align-items: center;
|
|
||||||
background-color: rgba(0, 0, 0, .05);
|
|
||||||
border-radius: 10rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
display: flex;
|
|
||||||
flex: 0 0 auto;
|
|
||||||
font-size: 26rpx;
|
|
||||||
gap: 10rpx;
|
|
||||||
justify-content: center;
|
|
||||||
min-height: 80rpx;
|
|
||||||
width: calc(50% - 10rpx);
|
|
||||||
}
|
|
||||||
|
|
||||||
.degree-item.active {
|
|
||||||
background-color: rgba(250, 44, 25, .1);
|
|
||||||
color: var(--nutui-color-primary);
|
|
||||||
}
|
|
||||||
|
|
||||||
.product-btns {
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
padding: 20rpx 0;
|
|
||||||
|
|
||||||
// border-bottom: 2rpx solid gainsboro;
|
|
||||||
// border-top: 2rpx solid gainsboro;
|
|
||||||
|
|
||||||
.reset {
|
|
||||||
flex: 1;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.confirm {
|
|
||||||
flex: 2;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.degree-btns {
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
.reset {
|
|
||||||
flex: 1;
|
|
||||||
/* 重置按钮占 1 份 */
|
|
||||||
}
|
|
||||||
|
|
||||||
.confirm {
|
|
||||||
flex: 2;
|
|
||||||
/* 确认按钮占 2 份 */
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.main-nav-container {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
background-color: #fff;
|
|
||||||
padding: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-button {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
width: 45%;
|
|
||||||
height: 160rpx;
|
|
||||||
border-radius: 20rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
padding: 0 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.phone-button {
|
|
||||||
background: linear-gradient(135deg, #6a5ae0, #8d7bfb);
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.parts-button {
|
|
||||||
background: linear-gradient(135deg, #ff6b6b, #ee5253);
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-button-bg {
|
|
||||||
position: absolute;
|
|
||||||
right: 0;
|
|
||||||
top: 0;
|
|
||||||
height: 100%;
|
|
||||||
width: 50%;
|
|
||||||
opacity: 0.2;
|
|
||||||
object-fit: cover;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-button-icon {
|
|
||||||
width: 90rpx;
|
|
||||||
height: 90rpx;
|
|
||||||
margin-right: 20rpx;
|
|
||||||
// border-radius: 20rpx;
|
|
||||||
z-index: 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-button-content {
|
|
||||||
z-index: 2;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-button-title {
|
|
||||||
font-size: 34rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-bottom: 8rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-button-desc {
|
|
||||||
font-size: 24rpx;
|
|
||||||
opacity: 0.85;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
65
pages/todo/todoAdd.vue
Normal file
65
pages/todo/todoAdd.vue
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<template>
|
||||||
|
|
||||||
|
<view class="page-content">
|
||||||
|
<view style=" padding: 20rpx;">
|
||||||
|
<nut-form>
|
||||||
|
<nut-form-item label="待办事项">
|
||||||
|
<nut-textarea v-model="form.content" :rows="3" placeholder="请输入待办事项" type="text" />
|
||||||
|
</nut-form-item>
|
||||||
|
<view style="align-items: center;text-align: center; padding: 20rpx 60rpx;">
|
||||||
|
<nut-button type="primary" block @click="onSubmit">
|
||||||
|
新增待办事项
|
||||||
|
</nut-button>
|
||||||
|
</view>
|
||||||
|
</nut-form>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
onMounted,
|
||||||
|
reactive,
|
||||||
|
ref,
|
||||||
|
toValue
|
||||||
|
} from 'vue';
|
||||||
|
import {
|
||||||
|
fetchAddTodo,
|
||||||
|
} from '@/api/index';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const form = reactive({
|
||||||
|
content: '',
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const onSubmit = () => {
|
||||||
|
console.log('form====>', form);
|
||||||
|
fetchAddTodo(form).then(res => {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: '新增待办事项成功'
|
||||||
|
})
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/todo/todoList'
|
||||||
|
});
|
||||||
|
|
||||||
|
}, 500)
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.page-content {
|
||||||
|
min-height: 100vh;
|
||||||
|
background-color: #f2f3f5;
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -4,40 +4,37 @@
|
|||||||
:auto-scroll-to-top-when-reload="false" v-model="dataList" @query="queryList">
|
:auto-scroll-to-top-when-reload="false" v-model="dataList" @query="queryList">
|
||||||
<view style="z-index: 10000;position: sticky;" :style="'top:0px'">
|
<view style="z-index: 10000;position: sticky;" :style="'top:0px'">
|
||||||
<view class="top-bar">
|
<view class="top-bar">
|
||||||
<nut-button type="primary" block plain @click="navigateTo('/pages/config/goodsAdd')">
|
<nut-button type="primary" block plain @click="navigateTo('/pages/todo/todoAdd')">
|
||||||
新增备忘录
|
添加待办事项
|
||||||
</nut-button>
|
</nut-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="todo-item" v-for="(item, index) in dataList" :key="index">
|
<view class="todo-item" v-for="(item, index) in dataList" :key="index">
|
||||||
|
<view class="todo-item-content">
|
||||||
<view class="goods-item-content">
|
<view class="todo-item-content-header" @click="onShowInfoPopup(item)">
|
||||||
<!-- @click="navigateTo('/pages/control/goods/edit?id=' + item.goods_id)" -->
|
<view style="font-size: 24rpx"> 记录人: {{ item.user.staff_name }}</view>
|
||||||
<view class="goods-item-content-header">
|
<view style="font-size: 24rpx"> 记录时间: {{ item.create_time }} </view>
|
||||||
<view style="font-size: 24rpx">记录人:</view>
|
|
||||||
<nut-tag custom-color="#1a1a1a">{{ item.user.staff_name }}</nut-tag>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="goods-item-content-body">
|
<view class="todo-item-content-body" @click="onShowInfoPopup(item)">
|
||||||
<view class="goods-item-content-body-desc">
|
<view class="todo-item-content-body-desc">
|
||||||
{{item.content}}
|
{{item.content}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="todo-item-content-footer">
|
||||||
<view class="goods-item-content-footer">
|
|
||||||
<view style="font-size: 24rpx; color: red;" v-if="item.status.value === 0">
|
<view style="font-size: 24rpx; color: red;" v-if="item.status.value === 0">
|
||||||
状态:<text>{{item.status.text}}</text>
|
状态:<text>{{item.status.text}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view style="font-size: 24rpx; color:chartreuse;" v-else>
|
<view style="font-size: 24rpx; color:chartreuse;" v-else>
|
||||||
状态:<text>{{item.status.text}}</text>
|
状态:<text>{{item.status.text}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="goods-item-content-footer-btn">
|
<view class="todo-item-content-footer-btn">
|
||||||
<nut-button size="small" type="success" v-if="item.status.value == 0"
|
<nut-button size="small" type="success" v-if="item.status.value == 0"
|
||||||
@click="onMark(item.goods_id,'1')">
|
@click="onMark(item.id,'1')">
|
||||||
标记已办
|
标记已办
|
||||||
</nut-button>
|
</nut-button>
|
||||||
<nut-button size="small" type="danger" v-if="item.status.value == 1"
|
<nut-button size="small" type="danger" v-if="item.status.value == 1"
|
||||||
@click="onMark(item.goods_id,'0')">
|
@click="onMark(item.id,'0')">
|
||||||
标记未办
|
标记未办
|
||||||
</nut-button>
|
</nut-button>
|
||||||
</view>
|
</view>
|
||||||
@@ -45,6 +42,20 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</z-paging>
|
</z-paging>
|
||||||
|
|
||||||
|
<!-- 弹出 -->
|
||||||
|
<nut-popup :custom-style="{ height: '50%' }" v-model:visible="visibleInfoPopup" position="bottom"
|
||||||
|
safe-area-inset-bottom :close-on-click-overlay="true" @close="onCloseInfoPopup">
|
||||||
|
<view>
|
||||||
|
<view class="title">记录人: {{tempTodo?.user?.staff_name}} </view>
|
||||||
|
<view class="room-info">
|
||||||
|
<view class="remark" v-if="tempTodo?.content">待办事项: {{tempTodo.content}}</view>
|
||||||
|
<view class="room-id" v-if="tempTodo?.create_time">添加时间: {{tempTodo.create_time}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</nut-popup>
|
||||||
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -62,22 +73,49 @@
|
|||||||
} from '@dcloudio/uni-app'
|
} from '@dcloudio/uni-app'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
fetchTodoList
|
fetchTodoList,
|
||||||
|
fetchEditTodo
|
||||||
} from '@/api/index';
|
} from '@/api/index';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
navigateTo,
|
navigateTo,
|
||||||
} from '@/utils/helper';
|
} from '@/utils/helper';
|
||||||
|
|
||||||
|
const tempTodo = reactive({})
|
||||||
|
|
||||||
|
const visibleInfoPopup = ref(false)
|
||||||
|
const onShowInfoPopup = (todo) => {
|
||||||
|
console.log("----", todo);
|
||||||
|
Object.assign(tempTodo, todo)
|
||||||
|
visibleInfoPopup.value = true
|
||||||
|
}
|
||||||
|
const onCloseInfoPopup = () => {
|
||||||
|
Object.assign(tempTodo, {})
|
||||||
|
visibleInfoPopup.value = false
|
||||||
|
console.log("关闭");
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// zp
|
|
||||||
const paging = ref(null);
|
const paging = ref(null);
|
||||||
// 列表
|
|
||||||
const dataList = ref([]);
|
const dataList = ref([]);
|
||||||
|
|
||||||
|
// 标记
|
||||||
|
const onMark = (id, status) => {
|
||||||
|
const params = {
|
||||||
|
id: id,
|
||||||
|
status: status
|
||||||
|
}
|
||||||
|
console.log(params);
|
||||||
|
fetchEditTodo(params).then(res => {
|
||||||
|
uni.showToast({
|
||||||
|
title: '标记成功',
|
||||||
|
icon: 'success',
|
||||||
|
});
|
||||||
|
paging.value.refresh();
|
||||||
|
}).catch(res => {
|
||||||
|
paging.value.refresh();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -92,10 +130,8 @@
|
|||||||
fetchTodoList(params).then(res => {
|
fetchTodoList(params).then(res => {
|
||||||
console.log('res=>', res.list);
|
console.log('res=>', res.list);
|
||||||
paging.value.complete(res.list);
|
paging.value.complete(res.list);
|
||||||
|
|
||||||
}).catch(res => {
|
}).catch(res => {
|
||||||
paging.value.complete(false);
|
paging.value.complete(false);
|
||||||
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -104,24 +140,6 @@
|
|||||||
|
|
||||||
const init = () => {
|
const init = () => {
|
||||||
console.log('init111');
|
console.log('init111');
|
||||||
// // 加载默认筛选项内容
|
|
||||||
// fetchFilterParmas().then(res => {
|
|
||||||
// console.log(res);
|
|
||||||
// // 处理成色
|
|
||||||
// let degree_params = res.degree_list;
|
|
||||||
// state.degree_params = degree_params.reduce((it, cit) => {
|
|
||||||
// it.push({
|
|
||||||
// text: cit.degree_name,
|
|
||||||
// value: cit.degree_id
|
|
||||||
// });
|
|
||||||
// return it;
|
|
||||||
// }, state.degree_params) || [];
|
|
||||||
// // 产品类型
|
|
||||||
// state.type_params = res.type_list
|
|
||||||
// // 产品下品牌列表
|
|
||||||
// state.drop_down_options = res.drop_down_options
|
|
||||||
// state.o_drop_down_options = res.o_drop_down_options
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
@@ -130,9 +148,9 @@
|
|||||||
if (paging.value) {
|
if (paging.value) {
|
||||||
paging.value.refresh();
|
paging.value.refresh();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
init();
|
init();
|
||||||
})
|
})
|
||||||
@@ -142,34 +160,16 @@
|
|||||||
.page-content {
|
.page-content {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background-color: #f2f3f5;
|
background-color: #f2f3f5;
|
||||||
--nut-menu-bar-box-shadow: none;
|
|
||||||
--nut-menu-item-content-padding: 20rpx;
|
|
||||||
--nut-menu-item-content-max-height: 900rpx;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// --nut-searchbar-input-padding:5px 0 5px 13px;
|
|
||||||
--nut-searchbar-input-height: 40px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.titleClass) .nut-menu__title-text {
|
|
||||||
font-size: 30rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
color: black;
|
|
||||||
}
|
|
||||||
|
|
||||||
.top-bar {
|
.top-bar {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
// padding: 20rpx;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 20rpx 60rpx;
|
padding: 20rpx 60rpx;
|
||||||
// display: flex;
|
|
||||||
// justify-content: space-between;
|
|
||||||
// border-top: 1px solid #eee;
|
|
||||||
// position: sticky;
|
|
||||||
// bottom: 0;
|
|
||||||
// z-index: 999;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -185,7 +185,7 @@
|
|||||||
gap: 20rpx;
|
gap: 20rpx;
|
||||||
|
|
||||||
|
|
||||||
.goods-item-content {
|
.todo-item-content {
|
||||||
// width: 100%;
|
// width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
@@ -194,72 +194,40 @@
|
|||||||
/* 首尾贴边,中间均分 */
|
/* 首尾贴边,中间均分 */
|
||||||
|
|
||||||
// gap: 15px;
|
// gap: 15px;
|
||||||
.goods-item-content-header {
|
.todo-item-content-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 6rpx 0;
|
padding: 6rpx 0;
|
||||||
gap: 20rpx;
|
gap: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.goods-item-content-body {
|
.todo-item-content-body {
|
||||||
padding: 6rpx 0;
|
padding: 6rpx 0;
|
||||||
|
|
||||||
.goods-item-content-body-desc {
|
.todo-item-content-body-desc {
|
||||||
color: #7c7c7c;
|
color: #7c7c7c;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
/* 关键属性 */
|
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
/* 使用弹性盒子布局 */
|
|
||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
/* 垂直方向排列 */
|
|
||||||
-webkit-line-clamp: 2;
|
-webkit-line-clamp: 2;
|
||||||
/* 限制显示两行 */
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
/* 超出部分隐藏 */
|
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
/* 超出时显示省略号 */
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.goods-item-content-stock {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
.goods-item-content-stock-desc {
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #999999;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-item-content-status-desc {
|
.todo-item-content-footer {
|
||||||
font-size: 26rpx;
|
|
||||||
color: red;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-item-content-footer {
|
|
||||||
padding: 6rpx 0;
|
padding: 6rpx 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
// width: 100%;
|
|
||||||
// flex-direction: row;
|
|
||||||
|
|
||||||
.goods-item-content-footer-btn {
|
.todo-item-content-footer-btn {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 10rpx;
|
gap: 10rpx;
|
||||||
|
|
||||||
.share-btn {
|
|
||||||
border-radius: 50rpx;
|
|
||||||
border: 2rpx solid red;
|
|
||||||
font-size: 26rpx;
|
|
||||||
align-items: center;
|
|
||||||
height: 54rpx;
|
|
||||||
color: red;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -267,215 +235,27 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
.filter-types {
|
|
||||||
|
|
||||||
display: flex;
|
.title {
|
||||||
justify-content: flex-start;
|
padding: 0 20rpx;
|
||||||
flex-direction: row;
|
margin-top: 20rpx;
|
||||||
align-items: center;
|
margin-bottom: 20rpx;
|
||||||
overflow: auto;
|
font-size: 28rpx;
|
||||||
gap: 10rpx;
|
font-weight: 400;
|
||||||
padding: 10rpx;
|
text-align: center;
|
||||||
// position: fixed;
|
|
||||||
// top: 0;
|
|
||||||
height: 60rpx;
|
|
||||||
// z-index: 9999;
|
|
||||||
background-color: #fff;
|
|
||||||
border-bottom: 2rpx solid gainsboro;
|
|
||||||
border-top: 2rpx solid gainsboro;
|
|
||||||
|
|
||||||
.filter-type-inner {
|
|
||||||
align-items: center;
|
|
||||||
background-color: rgba(0, 0, 0, .05);
|
|
||||||
border-radius: 16rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
display: -webkit-flex;
|
|
||||||
display: -ms-flexbox;
|
|
||||||
display: flex;
|
|
||||||
flex: 0 0 auto;
|
|
||||||
font-size: 28rpx;
|
|
||||||
gap: 15rpx;
|
|
||||||
padding: 10rpx 20rpx;
|
|
||||||
|
|
||||||
// image {
|
|
||||||
// height: 22px;
|
|
||||||
// width: 22px;
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
.filter-type-inner.active {
|
|
||||||
background-color: rgba(250, 44, 25, .1);
|
|
||||||
color: var(--nutui-color-primary);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabs-container {
|
.room-info {
|
||||||
display: flex;
|
text-align: left;
|
||||||
|
padding: 20rpx 20rpx;
|
||||||
.tab-pane-inner {
|
color: #666;
|
||||||
height: 600rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tabs-inner {
|
|
||||||
overflow-y: scroll;
|
|
||||||
height: 600rpx;
|
|
||||||
width: 160rpx;
|
|
||||||
background-color: #F5F5F5;
|
|
||||||
|
|
||||||
.tab-inner {
|
|
||||||
display: flex;
|
|
||||||
height: 60rpx;
|
|
||||||
padding: 10rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
background: #F5F5F5;
|
|
||||||
|
|
||||||
text {
|
|
||||||
width: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.tab-inner-active {
|
|
||||||
// background: #FFF;
|
|
||||||
background-color: rgba(250, 44, 25, .1);
|
|
||||||
color: var(--nutui-color-primary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.degree-inner {
|
|
||||||
display: flex;
|
|
||||||
flex: 1;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
// gap: 20rpx;
|
|
||||||
gap: 10rpx;
|
|
||||||
// padding: 11px;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-bottom: 60rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.degree-item {
|
|
||||||
align-items: center;
|
|
||||||
background-color: rgba(0, 0, 0, .05);
|
|
||||||
border-radius: 10rpx;
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
display: flex;
|
.room-id {
|
||||||
flex: 0 0 auto;
|
font-size: 28rpx;
|
||||||
font-size: 26rpx;
|
|
||||||
gap: 10rpx;
|
|
||||||
justify-content: center;
|
|
||||||
min-height: 80rpx;
|
|
||||||
width: calc(50% - 10rpx);
|
|
||||||
}
|
|
||||||
|
|
||||||
.degree-item.active {
|
|
||||||
background-color: rgba(250, 44, 25, .1);
|
|
||||||
color: var(--nutui-color-primary);
|
|
||||||
}
|
|
||||||
|
|
||||||
.product-btns {
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
padding: 20rpx 0;
|
|
||||||
|
|
||||||
// border-bottom: 2rpx solid gainsboro;
|
|
||||||
// border-top: 2rpx solid gainsboro;
|
|
||||||
|
|
||||||
.reset {
|
|
||||||
flex: 1;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
.remark {
|
||||||
.confirm {
|
font-size: 26rpx;
|
||||||
flex: 2;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.degree-btns {
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
.reset {
|
|
||||||
flex: 1;
|
|
||||||
/* 重置按钮占 1 份 */
|
|
||||||
}
|
|
||||||
|
|
||||||
.confirm {
|
|
||||||
flex: 2;
|
|
||||||
/* 确认按钮占 2 份 */
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.main-nav-container {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
background-color: #fff;
|
|
||||||
padding: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-button {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
width: 45%;
|
|
||||||
height: 160rpx;
|
|
||||||
border-radius: 20rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
padding: 0 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.phone-button {
|
|
||||||
background: linear-gradient(135deg, #6a5ae0, #8d7bfb);
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.parts-button {
|
|
||||||
background: linear-gradient(135deg, #ff6b6b, #ee5253);
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-button-bg {
|
|
||||||
position: absolute;
|
|
||||||
right: 0;
|
|
||||||
top: 0;
|
|
||||||
height: 100%;
|
|
||||||
width: 50%;
|
|
||||||
opacity: 0.2;
|
|
||||||
object-fit: cover;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-button-icon {
|
|
||||||
width: 90rpx;
|
|
||||||
height: 90rpx;
|
|
||||||
margin-right: 20rpx;
|
|
||||||
// border-radius: 20rpx;
|
|
||||||
z-index: 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-button-content {
|
|
||||||
z-index: 2;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-button-title {
|
|
||||||
font-size: 34rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-bottom: 8rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-button-desc {
|
|
||||||
font-size: 24rpx;
|
|
||||||
opacity: 0.85;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"index.js","sources":["api/index.ts"],"sourcesContent":["import { request } from \"./request\";\n\n// export function fetchNavList () {\n// \treturn request({\n// \t\turl:'/index/nav_list'\n// \t})\n// }\n\nexport function fetchLogin(data : {}) {\n\treturn request({\n\t\turl: '/index/login',\n\t\tdata: data,\n\t\tmethod: 'POST'\n\t})\n}\n\n\n\n// 获取商品\nexport function fetchGoods () {\n\treturn request({\n\t\turl:'/index/goods',\n\t})\n}\n// 获取套餐\nexport function fetchCombos(data : {}) {\n\treturn request({\n\t\turl: '/index/combos',\n\t\tdata: data,\n\t\tmethod: 'POST'\n\t});\n}\n// 获取房间\nexport function fetchRooms(data : {}) {\n\treturn request({\n\t\turl: '/index/rooms',\n\t\tdata: data,\n\t\tmethod: 'POST'\n\t});\n}\n\n// 预约\nexport function fetchBooking(data : {}) {\n\treturn request({\n\t\turl: '/index/booking',\n\t\tdata: data,\n\t\tmethod: 'POST'\n\t});\n}\n// 取消预约\nexport function fetchUnBooking(data : {}) {\n\treturn request({\n\t\turl: '/index/unbooking',\n\t\tdata: data,\n\t\tmethod: 'POST'\n\t});\n}\n\n// 开台/商品订单\nexport function fetchAddOrder(data : {}) {\n\treturn request({\n\t\turl: '/index/addOrder',\n\t\tdata: data,\n\t\tmethod: 'POST'\n\t});\n}\n\n// 开台/商品订单\nexport function fetchEditOrder(data : {}) {\n\treturn request({\n\t\turl: '/index/editOrder',\n\t\tdata: data,\n\t\tmethod: 'POST'\n\t});\n}\n\n// 房间订单详情\r\nexport function fetchRoomOrder(roomId : Number) {\r\n\treturn request({\r\n\t\turl: '/index/roomOrder',\r\n\t\tdata: { roomId: roomId },\r\n\t})\r\n}\r\n\n\n// 待办列表\nexport function fetchTodoList(data : {}) {\n\treturn request({\n\t\turl: '/index/todoList',\n\t\tdata: data,\n\t\tmethod: 'POST'\n\t});\n}\n"],"names":["request"],"mappings":";;AAQO,SAAS,WAAW,MAAW;AACrC,SAAOA,oBAAQ;AAAA,IACd,KAAK;AAAA,IACL;AAAA,IACA,QAAQ;AAAA,EAAA,CACR;AACF;AAKO,SAAS,aAAc;AAC7B,SAAOA,oBAAQ;AAAA,IACd,KAAI;AAAA,EAAA,CACJ;AACF;AAEO,SAAS,YAAY,MAAW;AACtC,SAAOA,oBAAQ;AAAA,IACd,KAAK;AAAA,IACL;AAAA,IACA,QAAQ;AAAA,EAAA,CACR;AACF;AAEO,SAAS,WAAW,MAAW;AACrC,SAAOA,oBAAQ;AAAA,IACd,KAAK;AAAA,IACL;AAAA,IACA,QAAQ;AAAA,EAAA,CACR;AACF;AAGO,SAAS,aAAa,MAAW;AACvC,SAAOA,oBAAQ;AAAA,IACd,KAAK;AAAA,IACL;AAAA,IACA,QAAQ;AAAA,EAAA,CACR;AACF;AAEO,SAAS,eAAe,MAAW;AACzC,SAAOA,oBAAQ;AAAA,IACd,KAAK;AAAA,IACL;AAAA,IACA,QAAQ;AAAA,EAAA,CACR;AACF;AAGO,SAAS,cAAc,MAAW;AACxC,SAAOA,oBAAQ;AAAA,IACd,KAAK;AAAA,IACL;AAAA,IACA,QAAQ;AAAA,EAAA,CACR;AACF;AAGO,SAAS,eAAe,MAAW;AACzC,SAAOA,oBAAQ;AAAA,IACd,KAAK;AAAA,IACL;AAAA,IACA,QAAQ;AAAA,EAAA,CACR;AACF;AAGO,SAAS,eAAe,QAAiB;AAC/C,SAAOA,oBAAQ;AAAA,IACd,KAAK;AAAA,IACL,MAAM,EAAE,OAAe;AAAA,EAAA,CACvB;AACF;AAIO,SAAS,cAAc,MAAW;AACxC,SAAOA,oBAAQ;AAAA,IACd,KAAK;AAAA,IACL;AAAA,IACA,QAAQ;AAAA,EAAA,CACR;AACF;;;;;;;;;;;"}
|
{"version":3,"file":"index.js","sources":["api/index.ts"],"sourcesContent":["import { request } from \"./request\";\n\n// export function fetchNavList () {\n// \treturn request({\n// \t\turl:'/index/nav_list'\n// \t})\n// }\n\nexport function fetchLogin(data : {}) {\n\treturn request({\n\t\turl: '/index/login',\n\t\tdata: data,\n\t\tmethod: 'POST'\n\t})\n}\n\n\n\n// 获取商品\nexport function fetchGoods () {\n\treturn request({\n\t\turl:'/index/goods',\n\t})\n}\n// 获取套餐\nexport function fetchCombos(data : {}) {\n\treturn request({\n\t\turl: '/index/combos',\n\t\tdata: data,\n\t\tmethod: 'POST'\n\t});\n}\n// 获取房间\nexport function fetchRooms(data : {}) {\n\treturn request({\n\t\turl: '/index/rooms',\n\t\tdata: data,\n\t\tmethod: 'POST'\n\t});\n}\n\n// 预约\nexport function fetchBooking(data : {}) {\n\treturn request({\n\t\turl: '/index/booking',\n\t\tdata: data,\n\t\tmethod: 'POST'\n\t});\n}\n// 取消预约\nexport function fetchUnBooking(data : {}) {\n\treturn request({\n\t\turl: '/index/unbooking',\n\t\tdata: data,\n\t\tmethod: 'POST'\n\t});\n}\n\n// 开台/商品订单\nexport function fetchAddOrder(data : {}) {\n\treturn request({\n\t\turl: '/index/addOrder',\n\t\tdata: data,\n\t\tmethod: 'POST'\n\t});\n}\n\n// 开台/商品订单\nexport function fetchEditOrder(data : {}) {\n\treturn request({\n\t\turl: '/index/editOrder',\n\t\tdata: data,\n\t\tmethod: 'POST'\n\t});\n}\n\n// 房间订单详情\r\nexport function fetchRoomOrder(roomId : Number) {\r\n\treturn request({\r\n\t\turl: '/index/roomOrder',\r\n\t\tdata: { roomId: roomId },\r\n\t})\r\n}\r\n\n\n// 待办列表\nexport function fetchTodoList(data : {}) {\n\treturn request({\n\t\turl: '/index/todoList',\n\t\tdata: data,\n\t\tmethod: 'POST'\n\t});\n}\n\n// 编辑待办\nexport function fetchEditTodo(data : {}) {\n\treturn request({\n\t\turl: '/index/editTodo',\n\t\tdata: data,\n\t\tmethod: 'POST'\n\t});\n}\n// 编辑待办\nexport function fetchAddTodo(data : {}) {\n\treturn request({\n\t\turl: '/index/addTodo',\n\t\tdata: data,\n\t\tmethod: 'POST'\n\t});\n}\n"],"names":["request"],"mappings":";;AAQO,SAAS,WAAW,MAAW;AACrC,SAAOA,oBAAQ;AAAA,IACd,KAAK;AAAA,IACL;AAAA,IACA,QAAQ;AAAA,EAAA,CACR;AACF;AAKO,SAAS,aAAc;AAC7B,SAAOA,oBAAQ;AAAA,IACd,KAAI;AAAA,EAAA,CACJ;AACF;AAEO,SAAS,YAAY,MAAW;AACtC,SAAOA,oBAAQ;AAAA,IACd,KAAK;AAAA,IACL;AAAA,IACA,QAAQ;AAAA,EAAA,CACR;AACF;AAEO,SAAS,WAAW,MAAW;AACrC,SAAOA,oBAAQ;AAAA,IACd,KAAK;AAAA,IACL;AAAA,IACA,QAAQ;AAAA,EAAA,CACR;AACF;AAGO,SAAS,aAAa,MAAW;AACvC,SAAOA,oBAAQ;AAAA,IACd,KAAK;AAAA,IACL;AAAA,IACA,QAAQ;AAAA,EAAA,CACR;AACF;AAEO,SAAS,eAAe,MAAW;AACzC,SAAOA,oBAAQ;AAAA,IACd,KAAK;AAAA,IACL;AAAA,IACA,QAAQ;AAAA,EAAA,CACR;AACF;AAGO,SAAS,cAAc,MAAW;AACxC,SAAOA,oBAAQ;AAAA,IACd,KAAK;AAAA,IACL;AAAA,IACA,QAAQ;AAAA,EAAA,CACR;AACF;AAGO,SAAS,eAAe,MAAW;AACzC,SAAOA,oBAAQ;AAAA,IACd,KAAK;AAAA,IACL;AAAA,IACA,QAAQ;AAAA,EAAA,CACR;AACF;AAGO,SAAS,eAAe,QAAiB;AAC/C,SAAOA,oBAAQ;AAAA,IACd,KAAK;AAAA,IACL,MAAM,EAAE,OAAe;AAAA,EAAA,CACvB;AACF;AAIO,SAAS,cAAc,MAAW;AACxC,SAAOA,oBAAQ;AAAA,IACd,KAAK;AAAA,IACL;AAAA,IACA,QAAQ;AAAA,EAAA,CACR;AACF;AAGO,SAAS,cAAc,MAAW;AACxC,SAAOA,oBAAQ;AAAA,IACd,KAAK;AAAA,IACL;AAAA,IACA,QAAQ;AAAA,EAAA,CACR;AACF;AAEO,SAAS,aAAa,MAAW;AACvC,SAAOA,oBAAQ;AAAA,IACd,KAAK;AAAA,IACL;AAAA,IACA,QAAQ;AAAA,EAAA,CACR;AACF;;;;;;;;;;;;;"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"app.js","sources":["App.vue","main.js"],"sourcesContent":["<script>\r\n\t// import {ShoppingCartType} from '@/common/constants';\r\n\texport default {\r\n\t\tonLaunch: function() {\r\n\t\t\t// const shoppingCartType = uni.getStorageSync('SHOPPING_CART_TYPE');\r\n\t\t\t// if (!shoppingCartType) {\r\n\t\t\t// \tuni.setStorageSync('SHOPPING_CART_TYPE', ShoppingCartType.PHONE)\r\n\t\t\t// }\r\n\r\n\t\t\t// uni.hideTabBar()\r\n\t\t\tconsole.log('App Launch')\r\n\t\t},\r\n\t\tonShow: function() {\r\n\t\t\t// uni.hideTabBar()\r\n\t\t\tconsole.log('App Show')\r\n\t\t},\r\n\t\tonHide: function() {\r\n\t\t\tconsole.log('App Hide')\r\n\t\t}\r\n\t}\r\n</script>\r\n\r\n<style lang=\"scss\">\r\n\t@import \"@/uni_modules/nutui-uni/styles/index.scss\";\r\n</style>","import App from './App'\n\n// #ifndef VUE3\nimport Vue from 'vue'\nimport './uni.promisify.adaptor'\nVue.config.productionTip = false\nApp.mpType = 'app'\nconst app = new Vue({\n ...App\n})\napp.$mount()\n// #endif\n\n// #ifdef VUE3\nimport { createSSRApp } from 'vue'\nexport function createApp() {\n const app = createSSRApp(App)\n return {\n app\n }\n}\n// #endif"],"names":["uni","createSSRApp","App"],"mappings":";;;;;;;;;;;;;;;;;;AAEC,MAAK,YAAU;AAAA,EACd,UAAU,WAAW;AAOpBA,kBAAAA,MAAA,MAAA,OAAA,iBAAY,YAAY;AAAA,EACxB;AAAA,EACD,QAAQ,WAAW;AAElBA,kBAAAA,MAAY,MAAA,OAAA,iBAAA,UAAU;AAAA,EACtB;AAAA,EACD,QAAQ,WAAW;AAClBA,kBAAAA,MAAY,MAAA,OAAA,iBAAA,UAAU;AAAA,EACvB;AACD;ACJM,SAAS,YAAY;AAC1B,QAAM,MAAMC,cAAY,aAACC,SAAG;AAC5B,SAAO;AAAA,IACL;AAAA,EACD;AACH;;;"}
|
{"version":3,"file":"app.js","sources":["App.vue","main.js"],"sourcesContent":["<script>\r\n\t// import {ShoppingCartType} from '@/common/constants';\r\n\texport default {\r\n\t\tonLaunch: function() {\r\n\t\t\t// const shoppingCartType = uni.getStorageSync('SHOPPING_CART_TYPE');\r\n\t\t\t// if (!shoppingCartType) {\r\n\t\t\t// \tuni.setStorageSync('SHOPPING_CART_TYPE', ShoppingCartType.PHONE)\r\n\t\t\t// }\r\n\r\n\t\t\t// uni.hideTabBar()\r\n\t\t\tconsole.log('App Launch')\r\n\t\t},\r\n\t\tonShow: function() {\r\n\t\t\t// uni.hideTabBar()\r\n\t\t\tconsole.log('App Show')\r\n\t\t},\r\n\t\tonHide: function() {\r\n\t\t\tconsole.log('App Hide')\r\n\t\t}\r\n\t}\r\n</script>\r\n\r\n<style lang=\"scss\">\r\n\t@import \"@/uni_modules/nutui-uni/styles/index.scss\";\r\n</style>","import App from './App'\n\n// #ifndef VUE3\nimport Vue from 'vue'\nimport './uni.promisify.adaptor'\nVue.config.productionTip = false\nApp.mpType = 'app'\nconst app = new Vue({\n ...App\n})\napp.$mount()\n// #endif\n\n// #ifdef VUE3\nimport { createSSRApp } from 'vue'\nexport function createApp() {\n const app = createSSRApp(App)\n return {\n app\n }\n}\n// #endif"],"names":["uni","createSSRApp","App"],"mappings":";;;;;;;;;;;;;;;;;;;AAEC,MAAK,YAAU;AAAA,EACd,UAAU,WAAW;AAOpBA,kBAAAA,MAAA,MAAA,OAAA,iBAAY,YAAY;AAAA,EACxB;AAAA,EACD,QAAQ,WAAW;AAElBA,kBAAAA,MAAY,MAAA,OAAA,iBAAA,UAAU;AAAA,EACtB;AAAA,EACD,QAAQ,WAAW;AAClBA,kBAAAA,MAAY,MAAA,OAAA,iBAAA,UAAU;AAAA,EACvB;AACD;ACJM,SAAS,YAAY;AAC1B,QAAM,MAAMC,cAAY,aAACC,SAAG;AAC5B,SAAO;AAAA,IACL;AAAA,EACD;AACH;;;"}
|
||||||
1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/todo/todoAdd.js.map
vendored
Normal file
1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/todo/todoAdd.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"todoAdd.js","sources":["pages/todo/todoAdd.vue","pages/todo/todoAdd.vue?type=page"],"sourcesContent":["<template>\r\n\r\n\t<view class=\"page-content\">\r\n\t\t<view style=\" padding: 20rpx;\">\r\n\t\t\t<nut-form>\r\n\t\t\t\t<nut-form-item label=\"待办事项\">\r\n\t\t\t\t\t<nut-textarea v-model=\"form.content\" :rows=\"3\" placeholder=\"请输入待办事项\" type=\"text\" />\r\n\t\t\t\t</nut-form-item>\r\n\t\t\t\t<view style=\"align-items: center;text-align: center; padding: 20rpx 60rpx;\">\r\n\t\t\t\t\t<nut-button type=\"primary\" block @click=\"onSubmit\">\r\n\t\t\t\t\t\t新增待办事项\r\n\t\t\t\t\t</nut-button>\r\n\t\t\t\t</view>\r\n\t\t\t</nut-form>\r\n\t\t</view>\r\n\t</view>\r\n</template>\r\n\r\n<script setup>\r\n\timport {\r\n\t\tonMounted,\r\n\t\treactive,\r\n\t\tref,\r\n\t\ttoValue\r\n\t} from 'vue';\r\n\timport {\r\n\t\tfetchAddTodo,\r\n\t} from '@/api/index';\r\n\r\n\r\n\r\n\r\n\tconst form = reactive({\r\n\t\tcontent: '',\r\n\t})\r\n\r\n\r\n\r\n\r\n\tconst onSubmit = () => {\r\n\t\tconsole.log('form====>', form);\r\n\t\tfetchAddTodo(form).then(res => {\r\n\t\t\tuni.showToast({\r\n\t\t\t\ticon: 'none',\r\n\t\t\t\ttitle: '新增待办事项成功'\r\n\t\t\t})\r\n\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tuni.switchTab({\r\n\t\t\t\t\turl: '/pages/todo/todoList'\r\n\t\t\t\t});\r\n\r\n\t\t\t}, 500)\r\n\r\n\t\t})\r\n\t}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n\t.page-content {\r\n\t\tmin-height: 100vh;\r\n\t\tbackground-color: #f2f3f5;\r\n\r\n\t}\r\n</style>","import MiniProgramPage from '/Users/iuu/Developer/PHP/Work/cmgd/mini-app/pages/todo/todoAdd.vue'\nwx.createPage(MiniProgramPage)"],"names":["reactive","uni","fetchAddTodo"],"mappings":";;;;;;;;;;;;;;;;;;;;AAgCC,UAAM,OAAOA,cAAAA,SAAS;AAAA,MACrB,SAAS;AAAA,IACX,CAAE;AAKD,UAAM,WAAW,MAAM;AACtBC,uEAAY,aAAa,IAAI;AAC7BC,gBAAAA,aAAa,IAAI,EAAE,KAAK,SAAO;AAC9BD,sBAAAA,MAAI,UAAU;AAAA,UACb,MAAM;AAAA,UACN,OAAO;AAAA,QACX,CAAI;AAED,mBAAW,MAAM;AAChBA,wBAAAA,MAAI,UAAU;AAAA,YACb,KAAK;AAAA,UACV,CAAK;AAAA,QAED,GAAE,GAAG;AAAA,MAET,CAAG;AAAA,IACD;;;;;;;;;;;;;;;;;;;;;;;ACtDF,GAAG,WAAW,eAAe;"}
|
||||||
File diff suppressed because one or more lines are too long
16
unpackage/dist/dev/mp-weixin/api/index.js
vendored
16
unpackage/dist/dev/mp-weixin/api/index.js
vendored
@@ -67,10 +67,26 @@ function fetchTodoList(data) {
|
|||||||
method: "POST"
|
method: "POST"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
function fetchEditTodo(data) {
|
||||||
|
return api_request.request({
|
||||||
|
url: "/index/editTodo",
|
||||||
|
data,
|
||||||
|
method: "POST"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function fetchAddTodo(data) {
|
||||||
|
return api_request.request({
|
||||||
|
url: "/index/addTodo",
|
||||||
|
data,
|
||||||
|
method: "POST"
|
||||||
|
});
|
||||||
|
}
|
||||||
exports.fetchAddOrder = fetchAddOrder;
|
exports.fetchAddOrder = fetchAddOrder;
|
||||||
|
exports.fetchAddTodo = fetchAddTodo;
|
||||||
exports.fetchBooking = fetchBooking;
|
exports.fetchBooking = fetchBooking;
|
||||||
exports.fetchCombos = fetchCombos;
|
exports.fetchCombos = fetchCombos;
|
||||||
exports.fetchEditOrder = fetchEditOrder;
|
exports.fetchEditOrder = fetchEditOrder;
|
||||||
|
exports.fetchEditTodo = fetchEditTodo;
|
||||||
exports.fetchGoods = fetchGoods;
|
exports.fetchGoods = fetchGoods;
|
||||||
exports.fetchLogin = fetchLogin;
|
exports.fetchLogin = fetchLogin;
|
||||||
exports.fetchRoomOrder = fetchRoomOrder;
|
exports.fetchRoomOrder = fetchRoomOrder;
|
||||||
|
|||||||
1
unpackage/dist/dev/mp-weixin/app.js
vendored
1
unpackage/dist/dev/mp-weixin/app.js
vendored
@@ -5,6 +5,7 @@ if (!Math) {
|
|||||||
"./pages/index/index.js";
|
"./pages/index/index.js";
|
||||||
"./pages/login/index.js";
|
"./pages/login/index.js";
|
||||||
"./pages/todo/todoList.js";
|
"./pages/todo/todoList.js";
|
||||||
|
"./pages/todo/todoAdd.js";
|
||||||
"./pages/index/orderAdd.js";
|
"./pages/index/orderAdd.js";
|
||||||
"./pages/index/orderEdit.js";
|
"./pages/index/orderEdit.js";
|
||||||
"./pages/index/goodsOrderAdd.js";
|
"./pages/index/goodsOrderAdd.js";
|
||||||
|
|||||||
1
unpackage/dist/dev/mp-weixin/app.json
vendored
1
unpackage/dist/dev/mp-weixin/app.json
vendored
@@ -3,6 +3,7 @@
|
|||||||
"pages/index/index",
|
"pages/index/index",
|
||||||
"pages/login/index",
|
"pages/login/index",
|
||||||
"pages/todo/todoList",
|
"pages/todo/todoList",
|
||||||
|
"pages/todo/todoAdd",
|
||||||
"pages/index/orderAdd",
|
"pages/index/orderAdd",
|
||||||
"pages/index/orderEdit",
|
"pages/index/orderEdit",
|
||||||
"pages/index/goodsOrderAdd",
|
"pages/index/goodsOrderAdd",
|
||||||
|
|||||||
66
unpackage/dist/dev/mp-weixin/menu.js
vendored
66
unpackage/dist/dev/mp-weixin/menu.js
vendored
@@ -1,66 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
require("./common/vendor.js");
|
|
||||||
require("./uni_modules/nutui-uni/components/_utils/env.js");
|
|
||||||
const uni_modules_nutuiUni_components__utils_props = require("./uni_modules/nutui-uni/components/_utils/props.js");
|
|
||||||
const MENU_KEY = Symbol("nut-menu");
|
|
||||||
const menuProps = {
|
|
||||||
...uni_modules_nutuiUni_components__utils_props.commonProps,
|
|
||||||
/**
|
|
||||||
* @description 选项的选中态图标颜色
|
|
||||||
*/
|
|
||||||
activeColor: uni_modules_nutuiUni_components__utils_props.makeStringProp(""),
|
|
||||||
/**
|
|
||||||
* @description 是否显示遮罩
|
|
||||||
*/
|
|
||||||
overlay: uni_modules_nutuiUni_components__utils_props.truthProp,
|
|
||||||
/**
|
|
||||||
* @description 是否锁定滚动
|
|
||||||
*/
|
|
||||||
lockScroll: uni_modules_nutuiUni_components__utils_props.truthProp,
|
|
||||||
/**
|
|
||||||
* @description 动画时长
|
|
||||||
*/
|
|
||||||
duration: {
|
|
||||||
type: [Number, String],
|
|
||||||
default: 300
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* @description 标题图标
|
|
||||||
*/
|
|
||||||
titleIcon: String,
|
|
||||||
/**
|
|
||||||
* @description 是否在点击遮罩层后关闭菜单
|
|
||||||
*/
|
|
||||||
closeOnClickOverlay: uni_modules_nutuiUni_components__utils_props.truthProp,
|
|
||||||
/**
|
|
||||||
* @description 展开方向
|
|
||||||
*/
|
|
||||||
direction: uni_modules_nutuiUni_components__utils_props.makeStringProp("down"),
|
|
||||||
/**
|
|
||||||
* @description 滚动后是否固定,可设置固定位置(需要配合 `scrollTop` 使用)
|
|
||||||
*/
|
|
||||||
scrollFixed: {
|
|
||||||
type: [Boolean, String, Number],
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* @description 页面的滚动距离,通过 `onPageScroll` 获取
|
|
||||||
*/
|
|
||||||
scrollTop: uni_modules_nutuiUni_components__utils_props.makeNumberProp(0),
|
|
||||||
/**
|
|
||||||
* @description 标题样式类名
|
|
||||||
*/
|
|
||||||
titleClass: [String],
|
|
||||||
/**
|
|
||||||
* @description 收起的图标
|
|
||||||
*/
|
|
||||||
upIcon: uni_modules_nutuiUni_components__utils_props.makeStringProp("rect-up"),
|
|
||||||
/**
|
|
||||||
* @description 展开时的图标
|
|
||||||
*/
|
|
||||||
downIcon: uni_modules_nutuiUni_components__utils_props.makeStringProp("rect-down"),
|
|
||||||
offset: Number
|
|
||||||
};
|
|
||||||
exports.MENU_KEY = MENU_KEY;
|
|
||||||
exports.menuProps = menuProps;
|
|
||||||
//# sourceMappingURL=../.sourcemap/mp-weixin/menu.js.map
|
|
||||||
@@ -1,291 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
const api_goods = require("../../api/goods.js");
|
|
||||||
const api_request = require("../../api/request.js");
|
|
||||||
if (!Array) {
|
|
||||||
const _easycom_nut_input2 = common_vendor.resolveComponent("nut-input");
|
|
||||||
const _easycom_nut_form_item2 = common_vendor.resolveComponent("nut-form-item");
|
|
||||||
const _easycom_nut_icon2 = common_vendor.resolveComponent("nut-icon");
|
|
||||||
const _easycom_nut_textarea2 = common_vendor.resolveComponent("nut-textarea");
|
|
||||||
const _easycom_nut_radio2 = common_vendor.resolveComponent("nut-radio");
|
|
||||||
const _easycom_nut_radio_group2 = common_vendor.resolveComponent("nut-radio-group");
|
|
||||||
const _easycom_shmily_drag_image2 = common_vendor.resolveComponent("shmily-drag-image");
|
|
||||||
const _easycom_nut_button2 = common_vendor.resolveComponent("nut-button");
|
|
||||||
const _easycom_nut_form2 = common_vendor.resolveComponent("nut-form");
|
|
||||||
const _easycom_nut_picker2 = common_vendor.resolveComponent("nut-picker");
|
|
||||||
const _easycom_nut_popup2 = common_vendor.resolveComponent("nut-popup");
|
|
||||||
const _easycom_nut_cascader2 = common_vendor.resolveComponent("nut-cascader");
|
|
||||||
(_easycom_nut_input2 + _easycom_nut_form_item2 + _easycom_nut_icon2 + _easycom_nut_textarea2 + _easycom_nut_radio2 + _easycom_nut_radio_group2 + _easycom_shmily_drag_image2 + _easycom_nut_button2 + _easycom_nut_form2 + _easycom_nut_picker2 + _easycom_nut_popup2 + _easycom_nut_cascader2)();
|
|
||||||
}
|
|
||||||
const _easycom_nut_input = () => "../../uni_modules/nutui-uni/components/input/input.js";
|
|
||||||
const _easycom_nut_form_item = () => "../../uni_modules/nutui-uni/components/formitem/formitem.js";
|
|
||||||
const _easycom_nut_icon = () => "../../uni_modules/nutui-uni/components/icon/icon.js";
|
|
||||||
const _easycom_nut_textarea = () => "../../uni_modules/nutui-uni/components/textarea/textarea.js";
|
|
||||||
const _easycom_nut_radio = () => "../../uni_modules/nutui-uni/components/radio/radio.js";
|
|
||||||
const _easycom_nut_radio_group = () => "../../uni_modules/nutui-uni/components/radiogroup/radiogroup.js";
|
|
||||||
const _easycom_shmily_drag_image = () => "../../uni_modules/shmily-drag-image/components/shmily-drag-image/shmily-drag-image.js";
|
|
||||||
const _easycom_nut_button = () => "../../uni_modules/nutui-uni/components/button/button.js";
|
|
||||||
const _easycom_nut_form = () => "../../uni_modules/nutui-uni/components/form/form.js";
|
|
||||||
const _easycom_nut_picker = () => "../../uni_modules/nutui-uni/components/picker/picker.js";
|
|
||||||
const _easycom_nut_popup = () => "../../uni_modules/nutui-uni/components/popup/popup.js";
|
|
||||||
const _easycom_nut_cascader = () => "../../uni_modules/nutui-uni/components/cascader/cascader.js";
|
|
||||||
if (!Math) {
|
|
||||||
(_easycom_nut_input + _easycom_nut_form_item + _easycom_nut_icon + _easycom_nut_textarea + _easycom_nut_radio + _easycom_nut_radio_group + _easycom_shmily_drag_image + _easycom_nut_button + _easycom_nut_form + _easycom_nut_picker + _easycom_nut_popup + _easycom_nut_cascader)();
|
|
||||||
}
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "goodsAdd",
|
|
||||||
setup(__props) {
|
|
||||||
const onScan = () => {
|
|
||||||
common_vendor.index.scanCode({
|
|
||||||
onlyFromCamera: true,
|
|
||||||
success: (res) => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/goodsAdd.vue:174", res);
|
|
||||||
form.goods_no = res.result;
|
|
||||||
},
|
|
||||||
fail: () => {
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
icon: "none",
|
|
||||||
title: "扫码失败"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const filter_params = common_vendor.reactive({});
|
|
||||||
const show_product_cascader = common_vendor.ref(false);
|
|
||||||
const show_degree_popup = common_vendor.ref(false);
|
|
||||||
const popup_degree_val = common_vendor.ref([]);
|
|
||||||
const cascader_product_val = common_vendor.ref([]);
|
|
||||||
const form = common_vendor.reactive({
|
|
||||||
// goods_id: 0,
|
|
||||||
goods_name: "",
|
|
||||||
goods_no: "",
|
|
||||||
goods_price: "",
|
|
||||||
goods_stock: "",
|
|
||||||
content: "",
|
|
||||||
details_content: "",
|
|
||||||
status: "10",
|
|
||||||
images: [],
|
|
||||||
add_person: "",
|
|
||||||
// disk: '未选择',
|
|
||||||
degree_id: 0,
|
|
||||||
degree_name: "未选择",
|
|
||||||
type_id: 0,
|
|
||||||
type_name: "未选择",
|
|
||||||
brand_id: 0,
|
|
||||||
brand_name: "未选择",
|
|
||||||
product_id: 0,
|
|
||||||
product_name: "未选择"
|
|
||||||
// video_url: ''
|
|
||||||
// goods_no: '',
|
|
||||||
// goods_status: '10',
|
|
||||||
// goods_sort: 0,
|
|
||||||
});
|
|
||||||
const onProductChange = (...args) => {
|
|
||||||
};
|
|
||||||
const onSubmit = () => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/goodsAdd.vue:271", "form====>", form);
|
|
||||||
api_goods.fetchGoodsAdd(form).then((res) => {
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
icon: "none",
|
|
||||||
title: "新增商品成功"
|
|
||||||
});
|
|
||||||
setTimeout(() => {
|
|
||||||
common_vendor.index.navigateBack({
|
|
||||||
delta: 1
|
|
||||||
// 返回上一页
|
|
||||||
});
|
|
||||||
}, 500);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const onProcutPathChange = (args) => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/goodsAdd.vue:299", args);
|
|
||||||
form.type_id = 0;
|
|
||||||
form.type_name = "";
|
|
||||||
form.brand_id = 0;
|
|
||||||
form.brand_name = "";
|
|
||||||
form.product_id = 0;
|
|
||||||
form.product_name = "";
|
|
||||||
if (args.length >= 1 && args[0] !== null) {
|
|
||||||
form.type_id = args[0].value;
|
|
||||||
form.type_name = args[0].text;
|
|
||||||
}
|
|
||||||
if (args.length >= 2 && args[1] !== null) {
|
|
||||||
form.brand_id = args[1].value;
|
|
||||||
form.brand_name = args[1].text;
|
|
||||||
}
|
|
||||||
if (args.length >= 3 && args[2] !== null) {
|
|
||||||
form.product_id = args[2].value;
|
|
||||||
form.product_name = args[2].text;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const onConfirmDegree = () => {
|
|
||||||
form.degree_id = popup_degree_val.value[0];
|
|
||||||
filter_params.degree_list.forEach((item) => {
|
|
||||||
if (item.degree_id === form.degree_id) {
|
|
||||||
form.degree_name = item.degree_name;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
show_degree_popup.value = false;
|
|
||||||
};
|
|
||||||
common_vendor.onMounted(() => {
|
|
||||||
api_goods.fetchFilterParmas(1).then((res) => {
|
|
||||||
Object.assign(filter_params, res);
|
|
||||||
filter_params.degree_list.unshift({
|
|
||||||
degree_id: 0,
|
|
||||||
degree_name: "未选择"
|
|
||||||
});
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/goodsAdd.vue:348", "filter_params", filter_params);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
const addGoodsImg = () => {
|
|
||||||
var _a;
|
|
||||||
common_vendor.index.chooseImage({
|
|
||||||
count: 9 - (((_a = form.image) == null ? void 0 : _a.length) || 0),
|
|
||||||
sourceType: ["album", "camera"],
|
|
||||||
success: (res) => {
|
|
||||||
res.tempFiles.forEach((file) => {
|
|
||||||
common_vendor.index.uploadFile({
|
|
||||||
url: api_request.getUploadImageUrl(),
|
|
||||||
filePath: file.path,
|
|
||||||
name: "iFile",
|
|
||||||
formData: {
|
|
||||||
group_id: 1
|
|
||||||
},
|
|
||||||
success: (res2) => {
|
|
||||||
let data = JSON.parse(res2.data).data;
|
|
||||||
form.images.push({
|
|
||||||
id: parseInt(data.file_id),
|
|
||||||
file_path: data.file_path
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return {
|
|
||||||
a: common_vendor.o(($event) => form.goods_name = $event),
|
|
||||||
b: common_vendor.p({
|
|
||||||
placeholder: "请输入名称",
|
|
||||||
type: "text",
|
|
||||||
modelValue: form.goods_name
|
|
||||||
}),
|
|
||||||
c: common_vendor.p({
|
|
||||||
label: "名称"
|
|
||||||
}),
|
|
||||||
d: common_vendor.o(onScan),
|
|
||||||
e: common_vendor.p({
|
|
||||||
name: "scan2",
|
|
||||||
size: "30",
|
|
||||||
["custom-color"]: "#000000"
|
|
||||||
}),
|
|
||||||
f: common_vendor.o(($event) => form.goods_no = $event),
|
|
||||||
g: common_vendor.p({
|
|
||||||
placeholder: "请输入串号",
|
|
||||||
type: "text",
|
|
||||||
modelValue: form.goods_no
|
|
||||||
}),
|
|
||||||
h: common_vendor.p({
|
|
||||||
label: "串号"
|
|
||||||
}),
|
|
||||||
i: common_vendor.o(($event) => form.goods_price = $event),
|
|
||||||
j: common_vendor.p({
|
|
||||||
placeholder: "请输入售价",
|
|
||||||
type: "nubmer",
|
|
||||||
modelValue: form.goods_price
|
|
||||||
}),
|
|
||||||
k: common_vendor.p({
|
|
||||||
label: "售价"
|
|
||||||
}),
|
|
||||||
l: common_vendor.o(($event) => form.content = $event),
|
|
||||||
m: common_vendor.p({
|
|
||||||
autosize: true,
|
|
||||||
placeholder: "请输入说明",
|
|
||||||
type: "text",
|
|
||||||
modelValue: form.content
|
|
||||||
}),
|
|
||||||
n: common_vendor.p({
|
|
||||||
label: "说明"
|
|
||||||
}),
|
|
||||||
o: common_vendor.o(($event) => form.details_content = $event),
|
|
||||||
p: common_vendor.p({
|
|
||||||
autosize: true,
|
|
||||||
placeholder: "请输入介绍",
|
|
||||||
type: "text",
|
|
||||||
modelValue: form.details_content
|
|
||||||
}),
|
|
||||||
q: common_vendor.p({
|
|
||||||
label: "介绍"
|
|
||||||
}),
|
|
||||||
r: common_vendor.p({
|
|
||||||
label: "10"
|
|
||||||
}),
|
|
||||||
s: common_vendor.p({
|
|
||||||
label: "20"
|
|
||||||
}),
|
|
||||||
t: common_vendor.o(($event) => form.status = $event),
|
|
||||||
v: common_vendor.p({
|
|
||||||
direction: "horizontal",
|
|
||||||
modelValue: form.status
|
|
||||||
}),
|
|
||||||
w: common_vendor.p({
|
|
||||||
label: "状态"
|
|
||||||
}),
|
|
||||||
x: common_vendor.t(form.degree_name),
|
|
||||||
y: common_vendor.o(($event) => show_degree_popup.value = true),
|
|
||||||
z: common_vendor.t(form.type_name),
|
|
||||||
A: common_vendor.t(form.brand_name),
|
|
||||||
B: common_vendor.t(form.product_name),
|
|
||||||
C: common_vendor.o(($event) => show_product_cascader.value = true),
|
|
||||||
D: common_vendor.o(($event) => form.images = $event),
|
|
||||||
E: common_vendor.p({
|
|
||||||
number: 9,
|
|
||||||
["add-image"]: addGoodsImg,
|
|
||||||
keyName: "file_path",
|
|
||||||
modelValue: form.images
|
|
||||||
}),
|
|
||||||
F: common_vendor.o(onSubmit),
|
|
||||||
G: common_vendor.p({
|
|
||||||
type: "primary",
|
|
||||||
block: true
|
|
||||||
}),
|
|
||||||
H: common_vendor.o(onConfirmDegree),
|
|
||||||
I: common_vendor.o(($event) => show_degree_popup.value = false),
|
|
||||||
J: common_vendor.o(($event) => popup_degree_val.value = $event),
|
|
||||||
K: common_vendor.p({
|
|
||||||
columns: filter_params.degree_list,
|
|
||||||
["field-names"]: {
|
|
||||||
text: "degree_name",
|
|
||||||
value: "degree_id"
|
|
||||||
},
|
|
||||||
title: "选择成色",
|
|
||||||
modelValue: popup_degree_val.value
|
|
||||||
}),
|
|
||||||
L: common_vendor.o(($event) => show_degree_popup.value = $event),
|
|
||||||
M: common_vendor.p({
|
|
||||||
position: "bottom",
|
|
||||||
["safe-area-inset-bottom"]: true,
|
|
||||||
visible: show_degree_popup.value
|
|
||||||
}),
|
|
||||||
N: common_vendor.o(onProductChange),
|
|
||||||
O: common_vendor.o(onProcutPathChange),
|
|
||||||
P: common_vendor.o(($event) => show_product_cascader.value = $event),
|
|
||||||
Q: common_vendor.o(($event) => cascader_product_val.value = $event),
|
|
||||||
R: common_vendor.p({
|
|
||||||
title: "机型选择",
|
|
||||||
["text-key"]: "label",
|
|
||||||
["value-key"]: "value",
|
|
||||||
["title-ellipsis"]: false,
|
|
||||||
["children-key"]: "children",
|
|
||||||
options: filter_params.drop_down_options,
|
|
||||||
visible: show_product_cascader.value,
|
|
||||||
modelValue: cascader_product_val.value
|
|
||||||
})
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-262d0393"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/config/goodsAdd.js.map
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "新增商品",
|
|
||||||
"enablePullDownRefresh": false,
|
|
||||||
"usingComponents": {
|
|
||||||
"nut-input": "../../uni_modules/nutui-uni/components/input/input",
|
|
||||||
"nut-form-item": "../../uni_modules/nutui-uni/components/formitem/formitem",
|
|
||||||
"nut-icon": "../../uni_modules/nutui-uni/components/icon/icon",
|
|
||||||
"nut-textarea": "../../uni_modules/nutui-uni/components/textarea/textarea",
|
|
||||||
"nut-radio": "../../uni_modules/nutui-uni/components/radio/radio",
|
|
||||||
"nut-radio-group": "../../uni_modules/nutui-uni/components/radiogroup/radiogroup",
|
|
||||||
"shmily-drag-image": "../../uni_modules/shmily-drag-image/components/shmily-drag-image/shmily-drag-image",
|
|
||||||
"nut-button": "../../uni_modules/nutui-uni/components/button/button",
|
|
||||||
"nut-form": "../../uni_modules/nutui-uni/components/form/form",
|
|
||||||
"nut-picker": "../../uni_modules/nutui-uni/components/picker/picker",
|
|
||||||
"nut-popup": "../../uni_modules/nutui-uni/components/popup/popup",
|
|
||||||
"nut-cascader": "../../uni_modules/nutui-uni/components/cascader/cascader"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<view class="page-content data-v-262d0393"><view class="data-v-262d0393" style="padding:20rpx"><nut-form class="data-v-262d0393" u-s="{{['d']}}" u-i="262d0393-0" bind:__l="__l"><nut-form-item wx:if="{{c}}" class="data-v-262d0393" u-s="{{['d']}}" u-i="262d0393-1,262d0393-0" bind:__l="__l" u-p="{{c}}"><nut-input wx:if="{{b}}" class="nut-input-text data-v-262d0393" u-i="262d0393-2,262d0393-1" bind:__l="__l" bindupdateModelValue="{{a}}" u-p="{{b}}"/></nut-form-item><nut-form-item wx:if="{{h}}" class="data-v-262d0393" u-s="{{['d']}}" u-i="262d0393-3,262d0393-0" bind:__l="__l" u-p="{{h}}"><nut-input wx:if="{{g}}" u-s="{{['right']}}" class="nut-input-text data-v-262d0393" u-i="262d0393-4,262d0393-3" bind:__l="__l" bindupdateModelValue="{{f}}" u-p="{{g}}"><nut-icon class="data-v-262d0393" bindclick="{{d}}" u-i="262d0393-5,262d0393-4" bind:__l="__l" u-p="{{e}}" slot="right"/></nut-input></nut-form-item><nut-form-item wx:if="{{k}}" class="data-v-262d0393" u-s="{{['d']}}" u-i="262d0393-6,262d0393-0" bind:__l="__l" u-p="{{k}}"><nut-input wx:if="{{j}}" class="nut-input-text data-v-262d0393" u-i="262d0393-7,262d0393-6" bind:__l="__l" bindupdateModelValue="{{i}}" u-p="{{j}}"/></nut-form-item><nut-form-item wx:if="{{n}}" class="data-v-262d0393" u-s="{{['d']}}" u-i="262d0393-8,262d0393-0" bind:__l="__l" u-p="{{n}}"><nut-textarea wx:if="{{m}}" class="data-v-262d0393" u-i="262d0393-9,262d0393-8" bind:__l="__l" bindupdateModelValue="{{l}}" u-p="{{m}}"/></nut-form-item><nut-form-item wx:if="{{q}}" class="data-v-262d0393" u-s="{{['d']}}" u-i="262d0393-10,262d0393-0" bind:__l="__l" u-p="{{q}}"><nut-textarea wx:if="{{p}}" class="data-v-262d0393" u-i="262d0393-11,262d0393-10" bind:__l="__l" bindupdateModelValue="{{o}}" u-p="{{p}}"/></nut-form-item><nut-form-item wx:if="{{w}}" class="data-v-262d0393" u-s="{{['d']}}" u-i="262d0393-12,262d0393-0" bind:__l="__l" u-p="{{w}}"><nut-radio-group wx:if="{{v}}" class="data-v-262d0393" u-s="{{['d']}}" u-i="262d0393-13,262d0393-12" bind:__l="__l" bindupdateModelValue="{{t}}" u-p="{{v}}"><nut-radio wx:if="{{r}}" class="data-v-262d0393" u-s="{{['d']}}" u-i="262d0393-14,262d0393-13" bind:__l="__l" u-p="{{r}}">下架</nut-radio><nut-radio wx:if="{{s}}" class="data-v-262d0393" u-s="{{['d']}}" u-i="262d0393-15,262d0393-13" bind:__l="__l" u-p="{{s}}">上架</nut-radio></nut-radio-group></nut-form-item><nut-form-item class="data-v-262d0393" u-s="{{['label','d']}}" u-i="262d0393-16,262d0393-0" bind:__l="__l"><view slot="label">成色</view><view class="data-v-262d0393" style="color:black" bindtap="{{y}}"><text class="data-v-262d0393">{{x}}</text></view></nut-form-item><nut-form-item class="data-v-262d0393" u-s="{{['label','d']}}" u-i="262d0393-17,262d0393-0" bind:__l="__l"><view slot="label">机型</view><view class="data-v-262d0393" style="color:black" bindtap="{{C}}"><text class="data-v-262d0393">{{z}},{{A}},{{B}}</text></view></nut-form-item><nut-form-item class="data-v-262d0393" u-s="{{['label','d']}}" u-i="262d0393-18,262d0393-0" bind:__l="__l"><view slot="label">商品图片</view><shmily-drag-image class="data-v-262d0393" u-i="262d0393-19,262d0393-18" bind:__l="__l" bindupdateModelValue="{{D}}" u-p="{{E}}"></shmily-drag-image></nut-form-item><view class="data-v-262d0393" style="align-items:center;text-align:center;padding:20rpx 60rpx"><nut-button wx:if="{{G}}" class="data-v-262d0393" u-s="{{['d']}}" bindclick="{{F}}" u-i="262d0393-20,262d0393-0" bind:__l="__l" u-p="{{G}}"> 新增商品 </nut-button></view></nut-form></view><nut-popup wx:if="{{M}}" class="data-v-262d0393" u-s="{{['d']}}" u-i="262d0393-21" bind:__l="__l" bindupdateVisible="{{L}}" u-p="{{M}}"><nut-picker wx:if="{{K}}" class="data-v-262d0393" bindconfirm="{{H}}" bindcancel="{{I}}" u-i="262d0393-22,262d0393-21" bind:__l="__l" bindupdateModelValue="{{J}}" u-p="{{K}}"></nut-picker></nut-popup><nut-cascader wx:if="{{R}}" class="data-v-262d0393" bindchange="{{N}}" bindpathChange="{{O}}" u-i="262d0393-23" bind:__l="__l" bindupdateVisible="{{P}}" bindupdateModelValue="{{Q}}" u-p="{{R}}"></nut-cascader></view>
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
.page-content.data-v-262d0393 {
|
|
||||||
min-height: 100vh;
|
|
||||||
background-color: #f2f3f5;
|
|
||||||
}
|
|
||||||
.list.data-v-262d0393 {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
flex-direction: column;
|
|
||||||
background: #ffffff;
|
|
||||||
align-items: center;
|
|
||||||
max-height: 300rpx;
|
|
||||||
overflow-y: scroll;
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
||||||
.list .list-item.data-v-262d0393 {
|
|
||||||
border-bottom: 1px solid #eee;
|
|
||||||
padding: 20rpx 10rpx;
|
|
||||||
}
|
|
||||||
@@ -1,101 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
const api_goods = require("../../api/goods.js");
|
|
||||||
const api_config = require("../../api/config.js");
|
|
||||||
if (!Array) {
|
|
||||||
const _easycom_nut_watermark2 = common_vendor.resolveComponent("nut-watermark");
|
|
||||||
const _easycom_nut_cell_group2 = common_vendor.resolveComponent("nut-cell-group");
|
|
||||||
(_easycom_nut_watermark2 + _easycom_nut_cell_group2)();
|
|
||||||
}
|
|
||||||
const _easycom_nut_watermark = () => "../../uni_modules/nutui-uni/components/watermark/watermark.js";
|
|
||||||
const _easycom_nut_cell_group = () => "../../uni_modules/nutui-uni/components/cellgroup/cellgroup.js";
|
|
||||||
if (!Math) {
|
|
||||||
(_easycom_nut_watermark + _easycom_nut_cell_group)();
|
|
||||||
}
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "goodsDetail",
|
|
||||||
setup(__props) {
|
|
||||||
const serviceTxt = common_vendor.ref("");
|
|
||||||
const id = common_vendor.ref(0);
|
|
||||||
const detail = common_vendor.reactive({});
|
|
||||||
common_vendor.onLoad((options) => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/goodsDetail.vue:83", "init");
|
|
||||||
getConfig();
|
|
||||||
id.value = options.id;
|
|
||||||
api_goods.fetchGoodsDetail(id.value).then((res) => {
|
|
||||||
Object.assign(detail, res);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
const getConfig = () => {
|
|
||||||
api_config.fetchGetConfig().then((res) => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/goodsDetail.vue:102", "getConfig=====>", res);
|
|
||||||
serviceTxt.value = res.appConfig.service_txt;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
common_vendor.onShareTimeline((res) => {
|
|
||||||
return {
|
|
||||||
title: detail.goods_name,
|
|
||||||
path: "/pages/mall/detail?id=" + detail.goods_id,
|
|
||||||
imageUrl: detail.image[0].file_path
|
|
||||||
};
|
|
||||||
});
|
|
||||||
common_vendor.onShareAppMessage((res) => {
|
|
||||||
return {
|
|
||||||
title: detail.goods_name,
|
|
||||||
path: "/pages/mall/detail?id=" + detail.goods_id,
|
|
||||||
imageUrl: detail.image[0].file_path
|
|
||||||
};
|
|
||||||
});
|
|
||||||
const showGoodsImages = (index) => {
|
|
||||||
common_vendor.index.previewImage({
|
|
||||||
current: index,
|
|
||||||
// 指定当前显示的图片索引
|
|
||||||
urls: detail.image.map((e) => {
|
|
||||||
return e.file_path;
|
|
||||||
})
|
|
||||||
});
|
|
||||||
};
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
var _a, _b, _c, _d, _e, _f, _g;
|
|
||||||
return common_vendor.e({
|
|
||||||
a: ((_a = detail.status) == null ? void 0 : _a.value) === 10
|
|
||||||
}, ((_b = detail.status) == null ? void 0 : _b.value) === 10 ? {
|
|
||||||
b: common_vendor.p({
|
|
||||||
["z-index"]: 1,
|
|
||||||
content: "此商品已下架"
|
|
||||||
})
|
|
||||||
} : {}, {
|
|
||||||
c: ((_c = detail.status) == null ? void 0 : _c.value) === 30
|
|
||||||
}, ((_d = detail.status) == null ? void 0 : _d.value) === 30 ? {
|
|
||||||
d: common_vendor.p({
|
|
||||||
["z-index"]: 1,
|
|
||||||
content: "此商品已锁定"
|
|
||||||
})
|
|
||||||
} : {}, {
|
|
||||||
e: ((_e = detail.status) == null ? void 0 : _e.value) === 40
|
|
||||||
}, ((_f = detail.status) == null ? void 0 : _f.value) === 40 ? {
|
|
||||||
f: common_vendor.p({
|
|
||||||
["z-index"]: 1,
|
|
||||||
content: "此商品已售出"
|
|
||||||
})
|
|
||||||
} : {}, {
|
|
||||||
g: common_vendor.f(detail.image, (item, idx, i0) => {
|
|
||||||
return {
|
|
||||||
a: item.file_path,
|
|
||||||
b: common_vendor.o(($event) => showGoodsImages(idx), idx),
|
|
||||||
c: idx
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
h: common_vendor.t(detail.goods_price),
|
|
||||||
i: common_vendor.t((_g = detail.degree) == null ? void 0 : _g.degree_name),
|
|
||||||
j: common_vendor.t(detail.goods_name),
|
|
||||||
k: common_vendor.t(detail.content),
|
|
||||||
l: common_vendor.t(serviceTxt.value)
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-d67bd9c3"]]);
|
|
||||||
_sfc_main.__runtimeHooks = 6;
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/config/goodsDetail.js.map
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "店铺商品详情",
|
|
||||||
"enablePullDownRefresh": false,
|
|
||||||
"usingComponents": {
|
|
||||||
"nut-watermark": "../../uni_modules/nutui-uni/components/watermark/watermark",
|
|
||||||
"nut-cell-group": "../../uni_modules/nutui-uni/components/cellgroup/cellgroup"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<view class="content data-v-d67bd9c3"><nut-watermark wx:if="{{a}}" class="mark1 data-v-d67bd9c3" u-i="d67bd9c3-0" bind:__l="__l" u-p="{{b}}"></nut-watermark><nut-watermark wx:if="{{c}}" class="mark1 data-v-d67bd9c3" u-i="d67bd9c3-1" bind:__l="__l" u-p="{{d}}"></nut-watermark><nut-watermark wx:if="{{e}}" class="mark1 data-v-d67bd9c3" u-i="d67bd9c3-2" bind:__l="__l" u-p="{{f}}"></nut-watermark><swiper class="swiper data-v-d67bd9c3" circular indicator-dots autoplay><swiper-item wx:for="{{g}}" wx:for-item="item" wx:key="c" class="data-v-d67bd9c3" bindtap="{{item.b}}"><image class="data-v-d67bd9c3" src="{{item.a}}" mode="aspectFill"></image></swiper-item></swiper><view class="goods_info data-v-d67bd9c3"><nut-cell-group class="data-v-d67bd9c3" u-s="{{['d']}}" u-i="d67bd9c3-3" bind:__l="__l"><view class="price data-v-d67bd9c3"><text class="unit data-v-d67bd9c3">¥</text><text class="value data-v-d67bd9c3">{{h}}</text></view></nut-cell-group><nut-cell-group class="data-v-d67bd9c3" u-s="{{['d']}}" u-i="d67bd9c3-4" bind:__l="__l"><view class="name data-v-d67bd9c3"><view class="top data-v-d67bd9c3"><view class="tag data-v-d67bd9c3"><text class="data-v-d67bd9c3">{{i}}</text></view><text class="title data-v-d67bd9c3">{{j}}</text></view><view class="data-v-d67bd9c3"><text class="info data-v-d67bd9c3">{{k}}</text></view></view></nut-cell-group><view class="service data-v-d67bd9c3"><view class="info data-v-d67bd9c3"><text class="title data-v-d67bd9c3">服务</text><text class="value data-v-d67bd9c3">{{l}}</text></view></view></view></view>
|
|
||||||
@@ -1,211 +0,0 @@
|
|||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
.bottom-action.data-v-d67bd9c3 {
|
|
||||||
position: fixed;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
height: 50px;
|
|
||||||
background: #fff;
|
|
||||||
width: calc(100% - 20px);
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
margin: 0 auto;
|
|
||||||
padding: 5px 10px;
|
|
||||||
}
|
|
||||||
.bottom-action .bottom-action-icon.data-v-d67bd9c3 {
|
|
||||||
align-items: center;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
.bottom-action .bottom-action-icon .bottom-action-icon-item.data-v-d67bd9c3 {
|
|
||||||
align-items: center;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
.bottom-action .bottom-action-icon .bottom-action-icon-item text.data-v-d67bd9c3 {
|
|
||||||
color: rgba(0, 0, 0, 0.5);
|
|
||||||
font-size: 11px;
|
|
||||||
}
|
|
||||||
.bottom-action .bottom-action-btn.data-v-d67bd9c3 {
|
|
||||||
-ms-flex-align: center;
|
|
||||||
-ms-flex-pack: end;
|
|
||||||
align-items: center;
|
|
||||||
display: flex;
|
|
||||||
gap: 5px;
|
|
||||||
justify-content: flex-end;
|
|
||||||
}
|
|
||||||
.content.data-v-d67bd9c3 {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
min-height: calc(100vh - 50px);
|
|
||||||
/* align-items: center; */
|
|
||||||
background-color: #f2f3f5;
|
|
||||||
--nut-cell-group-title-color: #000;
|
|
||||||
--nut-collapse-item-padding: 10px 10px 10px 10px;
|
|
||||||
--nut-collapse-wrapper-content-padding: 10px 10px 10px 10px;
|
|
||||||
--nut-collapse-item-color: #000;
|
|
||||||
padding-bottom: 50px;
|
|
||||||
}
|
|
||||||
.report-inner.data-v-d67bd9c3 {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 5px;
|
|
||||||
}
|
|
||||||
.report-inner .report-item .report-item-name.data-v-d67bd9c3 {
|
|
||||||
color: rgba(0, 0, 0, 0.9);
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
.report-inner .report-item .report-item-content.data-v-d67bd9c3 {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
.report-inner .report-item .report-item-content .report-item-content-item.data-v-d67bd9c3 {
|
|
||||||
padding-top: 2px;
|
|
||||||
padding-bottom: 2px;
|
|
||||||
width: 50%;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.count-item.data-v-d67bd9c3 {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
gap: 2px;
|
|
||||||
}
|
|
||||||
.swiper.data-v-d67bd9c3 {
|
|
||||||
width: 100%;
|
|
||||||
height: 414px;
|
|
||||||
}
|
|
||||||
.swiper image.data-v-d67bd9c3 {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
.goods_info.data-v-d67bd9c3 {
|
|
||||||
padding: 5px;
|
|
||||||
color: #000;
|
|
||||||
}
|
|
||||||
.goods_info .price.data-v-d67bd9c3 {
|
|
||||||
border-radius: 5px;
|
|
||||||
padding: 10px;
|
|
||||||
background: #fff;
|
|
||||||
}
|
|
||||||
.goods_info .price .unit.data-v-d67bd9c3 {
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
.goods_info .price .value.data-v-d67bd9c3 {
|
|
||||||
font-size: 24px;
|
|
||||||
}
|
|
||||||
.goods_info .name.data-v-d67bd9c3 {
|
|
||||||
border-radius: 5px;
|
|
||||||
padding: 10px;
|
|
||||||
background: #fff;
|
|
||||||
display: flex;
|
|
||||||
gap: 5px;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
.goods_info .name .top.data-v-d67bd9c3 {
|
|
||||||
display: flex;
|
|
||||||
gap: 5px;
|
|
||||||
}
|
|
||||||
.goods_info .name .top .tag.data-v-d67bd9c3 {
|
|
||||||
background: #000;
|
|
||||||
padding: 1px 2px;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
display: flex;
|
|
||||||
border-radius: 2px;
|
|
||||||
}
|
|
||||||
.goods_info .name .top .tag text.data-v-d67bd9c3 {
|
|
||||||
font-size: 10px;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
.goods_info .name .top .title.data-v-d67bd9c3 {
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
.goods_info .name .info.data-v-d67bd9c3 {
|
|
||||||
color: rgba(0, 0, 0, 0.7);
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
.goods_info .service.data-v-d67bd9c3 {
|
|
||||||
border-radius: 5px;
|
|
||||||
padding: 10px;
|
|
||||||
background: #fff;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
.goods_info .service .info.data-v-d67bd9c3 {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
gap: 5px;
|
|
||||||
}
|
|
||||||
.goods_info .service .info .title.data-v-d67bd9c3 {
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
.goods_info .service .info .value.data-v-d67bd9c3 {
|
|
||||||
color: rgba(0, 0, 0, 0.7);
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
.goods_info .service .right_icon.data-v-d67bd9c3 {
|
|
||||||
background-color: currentColor;
|
|
||||||
-webkit-mask: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiPjxwYXRoIGZpbGw9IiMxQTFBMUEiIGQ9Ik0zNTMuODMgMTU4LjE3YTQyLjY3IDQyLjY3IDAgMSAxIDYwLjM0LTYwLjM0bDM4NCAzODRhNDIuNjcgNDIuNjcgMCAwIDEgMCA2MC4zNmwtMzg0IDM4NGE0Mi42NyA0Mi42NyAwIDEgMS02MC4zNC02MC4zNkw3MDcuNjcgNTEyeiIvPjwvc3ZnPg==") 0 0/100% 100% no-repeat;
|
|
||||||
mask: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiPjxwYXRoIGZpbGw9IiMxQTFBMUEiIGQ9Ik0zNTMuODMgMTU4LjE3YTQyLjY3IDQyLjY3IDAgMSAxIDYwLjM0LTYwLjM0bDM4NCAzODRhNDIuNjcgNDIuNjcgMCAwIDEgMCA2MC4zNmwtMzg0IDM4NGE0Mi42NyA0Mi42NyAwIDEgMS02MC4zNC02MC4zNkw3MDcuNjcgNTEyeiIvPjwvc3ZnPg==") 0 0/100% 100% no-repeat;
|
|
||||||
width: 12px;
|
|
||||||
height: 12px;
|
|
||||||
}
|
|
||||||
.goods_info .report.data-v-d67bd9c3 {
|
|
||||||
border-radius: 5px;
|
|
||||||
padding: 1px;
|
|
||||||
background: #fff;
|
|
||||||
}
|
|
||||||
@@ -1,331 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
const api_goods = require("../../api/goods.js");
|
|
||||||
const api_request = require("../../api/request.js");
|
|
||||||
if (!Array) {
|
|
||||||
const _easycom_nut_input2 = common_vendor.resolveComponent("nut-input");
|
|
||||||
const _easycom_nut_form_item2 = common_vendor.resolveComponent("nut-form-item");
|
|
||||||
const _easycom_nut_icon2 = common_vendor.resolveComponent("nut-icon");
|
|
||||||
const _easycom_nut_textarea2 = common_vendor.resolveComponent("nut-textarea");
|
|
||||||
const _easycom_nut_radio2 = common_vendor.resolveComponent("nut-radio");
|
|
||||||
const _easycom_nut_radio_group2 = common_vendor.resolveComponent("nut-radio-group");
|
|
||||||
const _easycom_shmily_drag_image2 = common_vendor.resolveComponent("shmily-drag-image");
|
|
||||||
const _easycom_nut_button2 = common_vendor.resolveComponent("nut-button");
|
|
||||||
const _easycom_nut_form2 = common_vendor.resolveComponent("nut-form");
|
|
||||||
const _easycom_nut_picker2 = common_vendor.resolveComponent("nut-picker");
|
|
||||||
const _easycom_nut_popup2 = common_vendor.resolveComponent("nut-popup");
|
|
||||||
const _easycom_nut_cascader2 = common_vendor.resolveComponent("nut-cascader");
|
|
||||||
(_easycom_nut_input2 + _easycom_nut_form_item2 + _easycom_nut_icon2 + _easycom_nut_textarea2 + _easycom_nut_radio2 + _easycom_nut_radio_group2 + _easycom_shmily_drag_image2 + _easycom_nut_button2 + _easycom_nut_form2 + _easycom_nut_picker2 + _easycom_nut_popup2 + _easycom_nut_cascader2)();
|
|
||||||
}
|
|
||||||
const _easycom_nut_input = () => "../../uni_modules/nutui-uni/components/input/input.js";
|
|
||||||
const _easycom_nut_form_item = () => "../../uni_modules/nutui-uni/components/formitem/formitem.js";
|
|
||||||
const _easycom_nut_icon = () => "../../uni_modules/nutui-uni/components/icon/icon.js";
|
|
||||||
const _easycom_nut_textarea = () => "../../uni_modules/nutui-uni/components/textarea/textarea.js";
|
|
||||||
const _easycom_nut_radio = () => "../../uni_modules/nutui-uni/components/radio/radio.js";
|
|
||||||
const _easycom_nut_radio_group = () => "../../uni_modules/nutui-uni/components/radiogroup/radiogroup.js";
|
|
||||||
const _easycom_shmily_drag_image = () => "../../uni_modules/shmily-drag-image/components/shmily-drag-image/shmily-drag-image.js";
|
|
||||||
const _easycom_nut_button = () => "../../uni_modules/nutui-uni/components/button/button.js";
|
|
||||||
const _easycom_nut_form = () => "../../uni_modules/nutui-uni/components/form/form.js";
|
|
||||||
const _easycom_nut_picker = () => "../../uni_modules/nutui-uni/components/picker/picker.js";
|
|
||||||
const _easycom_nut_popup = () => "../../uni_modules/nutui-uni/components/popup/popup.js";
|
|
||||||
const _easycom_nut_cascader = () => "../../uni_modules/nutui-uni/components/cascader/cascader.js";
|
|
||||||
if (!Math) {
|
|
||||||
(_easycom_nut_input + _easycom_nut_form_item + _easycom_nut_icon + _easycom_nut_textarea + _easycom_nut_radio + _easycom_nut_radio_group + _easycom_shmily_drag_image + _easycom_nut_button + _easycom_nut_form + _easycom_nut_picker + _easycom_nut_popup + _easycom_nut_cascader)();
|
|
||||||
}
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "goodsEdit",
|
|
||||||
setup(__props) {
|
|
||||||
const id = common_vendor.ref(0);
|
|
||||||
const is_show_edit = common_vendor.ref(false);
|
|
||||||
const show_product_cascader = common_vendor.ref(false);
|
|
||||||
const show_degree_popup = common_vendor.ref(false);
|
|
||||||
const popup_degree_val = common_vendor.ref([]);
|
|
||||||
const cascader_product_val = common_vendor.ref([]);
|
|
||||||
const filter_params = common_vendor.reactive({});
|
|
||||||
const form = common_vendor.reactive({
|
|
||||||
goods_id: 0,
|
|
||||||
goods_name: "",
|
|
||||||
goods_no: "",
|
|
||||||
goods_price: "",
|
|
||||||
goods_stock: "",
|
|
||||||
content: "",
|
|
||||||
details_content: "",
|
|
||||||
status: "10",
|
|
||||||
images: [],
|
|
||||||
add_person: "",
|
|
||||||
degree_id: 0,
|
|
||||||
degree_name: "未选择",
|
|
||||||
type_id: 0,
|
|
||||||
type_name: "未选择",
|
|
||||||
brand_id: 0,
|
|
||||||
brand_name: "未选择",
|
|
||||||
product_id: 0,
|
|
||||||
product_name: "未选择"
|
|
||||||
});
|
|
||||||
common_vendor.onMounted(() => {
|
|
||||||
api_goods.fetchFilterParmas(1).then((res) => {
|
|
||||||
Object.assign(filter_params, res);
|
|
||||||
filter_params.degree_list.unshift({
|
|
||||||
degree_id: 0,
|
|
||||||
degree_name: "未选择"
|
|
||||||
});
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/goodsEdit.vue:166", "filter_params", filter_params);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
common_vendor.onLoad((options) => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/goodsEdit.vue:171", "goods_id===>", options.id);
|
|
||||||
id.value = options.id;
|
|
||||||
is_show_edit.value = false;
|
|
||||||
api_goods.fetchGoodsDetail(id.value).then((res) => {
|
|
||||||
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
||||||
is_show_edit.value = true;
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/goodsEdit.vue:177", "====>", res);
|
|
||||||
form.goods_id = res.goods_id;
|
|
||||||
form.goods_name = res.goods_name;
|
|
||||||
form.goods_no = res.goods_no;
|
|
||||||
form.goods_price = res.goods_price;
|
|
||||||
form.content = res.content;
|
|
||||||
form.details_content = res.details_content;
|
|
||||||
form.status = res.status.value.toString();
|
|
||||||
form.degree_id = ((_a = res.degree) == null ? void 0 : _a.degree_id) ?? 0;
|
|
||||||
form.degree_name = ((_b = res.degree) == null ? void 0 : _b.degree_name) ?? "未选择";
|
|
||||||
form.type_id = ((_c = res.type) == null ? void 0 : _c.type_id) ?? 0;
|
|
||||||
form.type_name = ((_d = res.type) == null ? void 0 : _d.name) ?? "未选择";
|
|
||||||
form.brand_id = ((_e = res.brand) == null ? void 0 : _e.brand_id) ?? 0;
|
|
||||||
form.brand_name = ((_f = res.brand) == null ? void 0 : _f.name) ?? "未选择";
|
|
||||||
form.product_id = ((_g = res.product) == null ? void 0 : _g.product_id) ?? 0;
|
|
||||||
form.product_name = ((_h = res.product) == null ? void 0 : _h.name) ?? "未选择";
|
|
||||||
popup_degree_val.value = [((_i = res.degree) == null ? void 0 : _i.degree_id) ?? 0];
|
|
||||||
cascader_product_val.value = [
|
|
||||||
((_j = res.type) == null ? void 0 : _j.type_id) ?? 0,
|
|
||||||
((_k = res.brand) == null ? void 0 : _k.brand_id) ?? 0,
|
|
||||||
((_l = res.product) == null ? void 0 : _l.product_id) ?? 0
|
|
||||||
];
|
|
||||||
form.images = [];
|
|
||||||
(_m = res.image) == null ? void 0 : _m.forEach((item) => {
|
|
||||||
form.images.push({
|
|
||||||
id: item.image_id,
|
|
||||||
file_path: item.file_path
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
const onProductChange = (...args) => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/goodsEdit.vue:210", 0, ...args);
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/goodsEdit.vue:211", cascader_product_val);
|
|
||||||
};
|
|
||||||
const onSubmit = () => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/goodsEdit.vue:215", "form===>", form);
|
|
||||||
api_goods.fetchGoodsEdit(form).then((res) => {
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
icon: "none",
|
|
||||||
title: "编辑商品成功"
|
|
||||||
});
|
|
||||||
setTimeout(() => {
|
|
||||||
common_vendor.index.navigateBack({
|
|
||||||
delta: 1
|
|
||||||
// 返回上一页
|
|
||||||
});
|
|
||||||
}, 500);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const onScan = () => {
|
|
||||||
common_vendor.index.scanCode({
|
|
||||||
onlyFromCamera: true,
|
|
||||||
success: (res) => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/goodsEdit.vue:237", res);
|
|
||||||
form.goods_no = res.result;
|
|
||||||
},
|
|
||||||
fail: () => {
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
icon: "none",
|
|
||||||
title: "扫码失败"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const onProcutPathChange = (args) => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/goodsEdit.vue:250", args);
|
|
||||||
form.type_id = 0;
|
|
||||||
form.type_name = "";
|
|
||||||
form.brand_id = 0;
|
|
||||||
form.brand_name = "";
|
|
||||||
form.product_id = 0;
|
|
||||||
form.product_name = "";
|
|
||||||
if (args.length >= 1 && args[0] !== null) {
|
|
||||||
form.type_id = args[0].value;
|
|
||||||
form.type_name = args[0].text;
|
|
||||||
}
|
|
||||||
if (args.length >= 2 && args[1] !== null) {
|
|
||||||
form.brand_id = args[1].value;
|
|
||||||
form.brand_name = args[1].text;
|
|
||||||
}
|
|
||||||
if (args.length >= 3 && args[2] !== null) {
|
|
||||||
form.product_id = args[2].value;
|
|
||||||
form.product_name = args[2].text;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const onConfirmDegree = () => {
|
|
||||||
form.degree_id = popup_degree_val.value[0];
|
|
||||||
filter_params.degree_list.forEach((item) => {
|
|
||||||
if (item.degree_id === form.degree_id) {
|
|
||||||
form.degree_name = item.degree_name;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
show_degree_popup.value = false;
|
|
||||||
};
|
|
||||||
const addGoodsImg = () => {
|
|
||||||
var _a;
|
|
||||||
common_vendor.index.chooseImage({
|
|
||||||
count: 9 - (((_a = form.image) == null ? void 0 : _a.length) || 0),
|
|
||||||
sourceType: ["album", "camera"],
|
|
||||||
success: (res) => {
|
|
||||||
res.tempFiles.forEach((file) => {
|
|
||||||
common_vendor.index.uploadFile({
|
|
||||||
url: api_request.getUploadImageUrl(),
|
|
||||||
filePath: file.path,
|
|
||||||
name: "iFile",
|
|
||||||
formData: {
|
|
||||||
group_id: 1
|
|
||||||
},
|
|
||||||
success: (res2) => {
|
|
||||||
let data = JSON.parse(res2.data).data;
|
|
||||||
form.images.push({
|
|
||||||
id: parseInt(data.file_id),
|
|
||||||
file_path: data.file_path
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: is_show_edit.value
|
|
||||||
}, is_show_edit.value ? {
|
|
||||||
b: common_vendor.o(($event) => form.goods_name = $event),
|
|
||||||
c: common_vendor.p({
|
|
||||||
placeholder: "请输入名称",
|
|
||||||
type: "text",
|
|
||||||
modelValue: form.goods_name
|
|
||||||
}),
|
|
||||||
d: common_vendor.p({
|
|
||||||
label: "名称"
|
|
||||||
}),
|
|
||||||
e: common_vendor.o(onScan),
|
|
||||||
f: common_vendor.p({
|
|
||||||
name: "scan2",
|
|
||||||
size: "30",
|
|
||||||
["custom-color"]: "#000000"
|
|
||||||
}),
|
|
||||||
g: common_vendor.o(($event) => form.goods_no = $event),
|
|
||||||
h: common_vendor.p({
|
|
||||||
placeholder: "请输入串号",
|
|
||||||
type: "text",
|
|
||||||
modelValue: form.goods_no
|
|
||||||
}),
|
|
||||||
i: common_vendor.p({
|
|
||||||
label: "串号"
|
|
||||||
}),
|
|
||||||
j: common_vendor.o(($event) => form.goods_price = $event),
|
|
||||||
k: common_vendor.p({
|
|
||||||
placeholder: "请输入售价",
|
|
||||||
type: "nubmer",
|
|
||||||
modelValue: form.goods_price
|
|
||||||
}),
|
|
||||||
l: common_vendor.p({
|
|
||||||
label: "售价"
|
|
||||||
}),
|
|
||||||
m: common_vendor.o(($event) => form.content = $event),
|
|
||||||
n: common_vendor.p({
|
|
||||||
autosize: true,
|
|
||||||
placeholder: "请输入说明",
|
|
||||||
type: "text",
|
|
||||||
modelValue: form.content
|
|
||||||
}),
|
|
||||||
o: common_vendor.p({
|
|
||||||
label: "说明"
|
|
||||||
}),
|
|
||||||
p: common_vendor.o(($event) => form.details_content = $event),
|
|
||||||
q: common_vendor.p({
|
|
||||||
autosize: true,
|
|
||||||
placeholder: "请输入介绍",
|
|
||||||
type: "text",
|
|
||||||
modelValue: form.details_content
|
|
||||||
}),
|
|
||||||
r: common_vendor.p({
|
|
||||||
label: "介绍"
|
|
||||||
}),
|
|
||||||
s: common_vendor.p({
|
|
||||||
label: "10"
|
|
||||||
}),
|
|
||||||
t: common_vendor.p({
|
|
||||||
label: "20"
|
|
||||||
}),
|
|
||||||
v: common_vendor.o(($event) => form.status = $event),
|
|
||||||
w: common_vendor.p({
|
|
||||||
direction: "horizontal",
|
|
||||||
modelValue: form.status
|
|
||||||
}),
|
|
||||||
x: common_vendor.p({
|
|
||||||
label: "状态"
|
|
||||||
}),
|
|
||||||
y: common_vendor.t(form.degree_name),
|
|
||||||
z: common_vendor.o(($event) => show_degree_popup.value = true),
|
|
||||||
A: common_vendor.t(form.type_name),
|
|
||||||
B: common_vendor.t(form.brand_name),
|
|
||||||
C: common_vendor.t(form.product_name),
|
|
||||||
D: common_vendor.o(($event) => show_product_cascader.value = true),
|
|
||||||
E: common_vendor.o(($event) => form.images = $event),
|
|
||||||
F: common_vendor.p({
|
|
||||||
number: 9,
|
|
||||||
["add-image"]: addGoodsImg,
|
|
||||||
keyName: "file_path",
|
|
||||||
modelValue: form.images
|
|
||||||
}),
|
|
||||||
G: common_vendor.o(onSubmit),
|
|
||||||
H: common_vendor.p({
|
|
||||||
type: "primary",
|
|
||||||
block: true
|
|
||||||
})
|
|
||||||
} : {}, {
|
|
||||||
I: common_vendor.o(onConfirmDegree),
|
|
||||||
J: common_vendor.o(($event) => show_degree_popup.value = false),
|
|
||||||
K: common_vendor.o(($event) => popup_degree_val.value = $event),
|
|
||||||
L: common_vendor.p({
|
|
||||||
columns: filter_params.degree_list,
|
|
||||||
["field-names"]: {
|
|
||||||
text: "degree_name",
|
|
||||||
value: "degree_id"
|
|
||||||
},
|
|
||||||
title: "选择成色",
|
|
||||||
modelValue: popup_degree_val.value
|
|
||||||
}),
|
|
||||||
M: common_vendor.o(($event) => show_degree_popup.value = $event),
|
|
||||||
N: common_vendor.p({
|
|
||||||
position: "bottom",
|
|
||||||
["safe-area-inset-bottom"]: true,
|
|
||||||
visible: show_degree_popup.value
|
|
||||||
}),
|
|
||||||
O: common_vendor.o(onProductChange),
|
|
||||||
P: common_vendor.o(onProcutPathChange),
|
|
||||||
Q: common_vendor.o(($event) => show_product_cascader.value = $event),
|
|
||||||
R: common_vendor.o(($event) => cascader_product_val.value = $event),
|
|
||||||
S: common_vendor.p({
|
|
||||||
title: "机型选择",
|
|
||||||
["text-key"]: "label",
|
|
||||||
["value-key"]: "value",
|
|
||||||
["title-ellipsis"]: false,
|
|
||||||
["children-key"]: "children",
|
|
||||||
options: filter_params.drop_down_options,
|
|
||||||
visible: show_product_cascader.value,
|
|
||||||
modelValue: cascader_product_val.value
|
|
||||||
})
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-a30aee39"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/config/goodsEdit.js.map
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "编辑商品",
|
|
||||||
"enablePullDownRefresh": false,
|
|
||||||
"usingComponents": {
|
|
||||||
"nut-input": "../../uni_modules/nutui-uni/components/input/input",
|
|
||||||
"nut-form-item": "../../uni_modules/nutui-uni/components/formitem/formitem",
|
|
||||||
"nut-icon": "../../uni_modules/nutui-uni/components/icon/icon",
|
|
||||||
"nut-textarea": "../../uni_modules/nutui-uni/components/textarea/textarea",
|
|
||||||
"nut-radio": "../../uni_modules/nutui-uni/components/radio/radio",
|
|
||||||
"nut-radio-group": "../../uni_modules/nutui-uni/components/radiogroup/radiogroup",
|
|
||||||
"shmily-drag-image": "../../uni_modules/shmily-drag-image/components/shmily-drag-image/shmily-drag-image",
|
|
||||||
"nut-button": "../../uni_modules/nutui-uni/components/button/button",
|
|
||||||
"nut-form": "../../uni_modules/nutui-uni/components/form/form",
|
|
||||||
"nut-picker": "../../uni_modules/nutui-uni/components/picker/picker",
|
|
||||||
"nut-popup": "../../uni_modules/nutui-uni/components/popup/popup",
|
|
||||||
"nut-cascader": "../../uni_modules/nutui-uni/components/cascader/cascader"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<view class="page-content data-v-a30aee39"><view wx:if="{{a}}" class="data-v-a30aee39" style="padding:20rpx"><nut-form class="data-v-a30aee39" u-s="{{['d']}}" u-i="a30aee39-0" bind:__l="__l"><nut-form-item wx:if="{{d}}" class="data-v-a30aee39" u-s="{{['d']}}" u-i="a30aee39-1,a30aee39-0" bind:__l="__l" u-p="{{d}}"><nut-input wx:if="{{c}}" class="nut-input-text data-v-a30aee39" u-i="a30aee39-2,a30aee39-1" bind:__l="__l" bindupdateModelValue="{{b}}" u-p="{{c}}"/></nut-form-item><nut-form-item wx:if="{{i}}" class="data-v-a30aee39" u-s="{{['d']}}" u-i="a30aee39-3,a30aee39-0" bind:__l="__l" u-p="{{i}}"><nut-input wx:if="{{h}}" u-s="{{['right']}}" class="nut-input-text data-v-a30aee39" u-i="a30aee39-4,a30aee39-3" bind:__l="__l" bindupdateModelValue="{{g}}" u-p="{{h}}"><nut-icon class="data-v-a30aee39" bindclick="{{e}}" u-i="a30aee39-5,a30aee39-4" bind:__l="__l" u-p="{{f}}" slot="right"/></nut-input></nut-form-item><nut-form-item wx:if="{{l}}" class="data-v-a30aee39" u-s="{{['d']}}" u-i="a30aee39-6,a30aee39-0" bind:__l="__l" u-p="{{l}}"><nut-input wx:if="{{k}}" class="nut-input-text data-v-a30aee39" u-i="a30aee39-7,a30aee39-6" bind:__l="__l" bindupdateModelValue="{{j}}" u-p="{{k}}"/></nut-form-item><nut-form-item wx:if="{{o}}" class="data-v-a30aee39" u-s="{{['d']}}" u-i="a30aee39-8,a30aee39-0" bind:__l="__l" u-p="{{o}}"><nut-textarea wx:if="{{n}}" class="data-v-a30aee39" u-i="a30aee39-9,a30aee39-8" bind:__l="__l" bindupdateModelValue="{{m}}" u-p="{{n}}"/></nut-form-item><nut-form-item wx:if="{{r}}" class="data-v-a30aee39" u-s="{{['d']}}" u-i="a30aee39-10,a30aee39-0" bind:__l="__l" u-p="{{r}}"><nut-textarea wx:if="{{q}}" class="data-v-a30aee39" u-i="a30aee39-11,a30aee39-10" bind:__l="__l" bindupdateModelValue="{{p}}" u-p="{{q}}"/></nut-form-item><nut-form-item wx:if="{{x}}" class="data-v-a30aee39" u-s="{{['d']}}" u-i="a30aee39-12,a30aee39-0" bind:__l="__l" u-p="{{x}}"><nut-radio-group wx:if="{{w}}" class="data-v-a30aee39" u-s="{{['d']}}" u-i="a30aee39-13,a30aee39-12" bind:__l="__l" bindupdateModelValue="{{v}}" u-p="{{w}}"><nut-radio wx:if="{{s}}" class="data-v-a30aee39" u-s="{{['d']}}" u-i="a30aee39-14,a30aee39-13" bind:__l="__l" u-p="{{s}}">下架</nut-radio><nut-radio wx:if="{{t}}" class="data-v-a30aee39" u-s="{{['d']}}" u-i="a30aee39-15,a30aee39-13" bind:__l="__l" u-p="{{t}}">上架</nut-radio></nut-radio-group></nut-form-item><nut-form-item class="data-v-a30aee39" u-s="{{['label','d']}}" u-i="a30aee39-16,a30aee39-0" bind:__l="__l"><view slot="label">成色</view><view class="data-v-a30aee39" style="color:black" bindtap="{{z}}"><text class="data-v-a30aee39">{{y}}</text></view></nut-form-item><nut-form-item class="data-v-a30aee39" u-s="{{['label','d']}}" u-i="a30aee39-17,a30aee39-0" bind:__l="__l"><view slot="label">机型</view><view class="data-v-a30aee39" style="color:black" bindtap="{{D}}"><text class="data-v-a30aee39">{{A}},{{B}},{{C}}</text></view></nut-form-item><nut-form-item class="data-v-a30aee39" u-s="{{['label','d']}}" u-i="a30aee39-18,a30aee39-0" bind:__l="__l"><view slot="label">商品图片</view><shmily-drag-image class="data-v-a30aee39" u-i="a30aee39-19,a30aee39-18" bind:__l="__l" bindupdateModelValue="{{E}}" u-p="{{F}}"></shmily-drag-image></nut-form-item><view class="data-v-a30aee39" style="align-items:center;text-align:center;padding:20rpx 60rpx"><nut-button wx:if="{{H}}" class="data-v-a30aee39" u-s="{{['d']}}" bindclick="{{G}}" u-i="a30aee39-20,a30aee39-0" bind:__l="__l" u-p="{{H}}"> 保存修改 </nut-button></view></nut-form></view><nut-popup wx:if="{{N}}" class="data-v-a30aee39" u-s="{{['d']}}" u-i="a30aee39-21" bind:__l="__l" bindupdateVisible="{{M}}" u-p="{{N}}"><nut-picker wx:if="{{L}}" class="data-v-a30aee39" bindconfirm="{{I}}" bindcancel="{{J}}" u-i="a30aee39-22,a30aee39-21" bind:__l="__l" bindupdateModelValue="{{K}}" u-p="{{L}}"></nut-picker></nut-popup><nut-cascader wx:if="{{S}}" class="data-v-a30aee39" bindchange="{{O}}" bindpathChange="{{P}}" u-i="a30aee39-23" bind:__l="__l" bindupdateVisible="{{Q}}" bindupdateModelValue="{{R}}" u-p="{{S}}"></nut-cascader></view>
|
|
||||||
@@ -1,179 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
const api_goods = require("../../api/goods.js");
|
|
||||||
const utils_helper = require("../../utils/helper.js");
|
|
||||||
if (!Array) {
|
|
||||||
const _easycom_nut_button2 = common_vendor.resolveComponent("nut-button");
|
|
||||||
const _easycom_nut_tag2 = common_vendor.resolveComponent("nut-tag");
|
|
||||||
const _easycom_z_paging2 = common_vendor.resolveComponent("z-paging");
|
|
||||||
(_easycom_nut_button2 + _easycom_nut_tag2 + _easycom_z_paging2)();
|
|
||||||
}
|
|
||||||
const _easycom_nut_button = () => "../../uni_modules/nutui-uni/components/button/button.js";
|
|
||||||
const _easycom_nut_tag = () => "../../uni_modules/nutui-uni/components/tag/tag.js";
|
|
||||||
const _easycom_z_paging = () => "../../uni_modules/z-paging/components/z-paging/z-paging.js";
|
|
||||||
if (!Math) {
|
|
||||||
(_easycom_nut_button + _easycom_nut_tag + _easycom_z_paging)();
|
|
||||||
}
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "goodsList",
|
|
||||||
setup(__props) {
|
|
||||||
const getImg = (goods) => {
|
|
||||||
var _a, _b;
|
|
||||||
const url = (_b = (_a = goods == null ? void 0 : goods.image) == null ? void 0 : _a[0]) == null ? void 0 : _b.file_path;
|
|
||||||
return url ? url + "?imageView2/1/w/200/h/200" : "";
|
|
||||||
};
|
|
||||||
const paging = common_vendor.ref(null);
|
|
||||||
const dataList = common_vendor.ref([]);
|
|
||||||
common_vendor.ref(null);
|
|
||||||
common_vendor.ref(null);
|
|
||||||
common_vendor.ref(null);
|
|
||||||
const state = common_vendor.reactive({
|
|
||||||
type_params: [],
|
|
||||||
// 产品类型
|
|
||||||
drop_down_options: [],
|
|
||||||
// 产品类型下的品牌列表
|
|
||||||
o_drop_down_options: [],
|
|
||||||
// 价格排序
|
|
||||||
price_sort_params: [
|
|
||||||
{
|
|
||||||
text: "默认排序",
|
|
||||||
value: ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: "价格升序",
|
|
||||||
value: "ascend"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: "价格降序",
|
|
||||||
value: "descend"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
// 成色所有选项
|
|
||||||
degree_params: [],
|
|
||||||
price_sort: "",
|
|
||||||
price_sort_name: "默认排序",
|
|
||||||
degree_ids: [],
|
|
||||||
degree_name: "成色",
|
|
||||||
product_name: "机型",
|
|
||||||
type_id: 1,
|
|
||||||
// 产品类型id 默认 1 手机
|
|
||||||
type_name: "手机",
|
|
||||||
brand_id: 0,
|
|
||||||
// 品牌id // 默认 0 全部
|
|
||||||
brand_name: "全部",
|
|
||||||
product_ids: [0],
|
|
||||||
// 机型ids 默认 0 全部
|
|
||||||
search_val: ""
|
|
||||||
// 搜索
|
|
||||||
});
|
|
||||||
common_vendor.computed(() => {
|
|
||||||
var _a;
|
|
||||||
return (_a = state == null ? void 0 : state.o_drop_down_options[state.type_id]) == null ? void 0 : _a.children[state.brand_id].children;
|
|
||||||
});
|
|
||||||
const queryList = (pageNo, pageSize) => {
|
|
||||||
const params = {
|
|
||||||
pageSize,
|
|
||||||
page: pageNo,
|
|
||||||
price_sort: state.price_sort,
|
|
||||||
degree_ids: state.degree_ids,
|
|
||||||
type_id: state.type_id,
|
|
||||||
brand_id: state.brand_id,
|
|
||||||
product_ids: state.product_ids,
|
|
||||||
search: state.search_val
|
|
||||||
};
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/goodsList.vue:299", params);
|
|
||||||
api_goods.fetchSysGoodsList(params).then((res) => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/goodsList.vue:301", "res=>", res.list);
|
|
||||||
paging.value.complete(res.list);
|
|
||||||
}).catch((res) => {
|
|
||||||
paging.value.complete(false);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const init = () => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/goodsList.vue:318", "init111");
|
|
||||||
api_goods.fetchFilterParmas().then((res) => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/goodsList.vue:321", res);
|
|
||||||
let degree_params = res.degree_list;
|
|
||||||
state.degree_params = degree_params.reduce((it, cit) => {
|
|
||||||
it.push({
|
|
||||||
text: cit.degree_name,
|
|
||||||
value: cit.degree_id
|
|
||||||
});
|
|
||||||
return it;
|
|
||||||
}, state.degree_params) || [];
|
|
||||||
state.type_params = res.type_list;
|
|
||||||
state.drop_down_options = res.drop_down_options;
|
|
||||||
state.o_drop_down_options = res.o_drop_down_options;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
common_vendor.onShow(() => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/goodsList.vue:340", "onshow---");
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/goodsList.vue:341", "paging.value", paging.value);
|
|
||||||
if (paging.value) {
|
|
||||||
paging.value.refresh();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
common_vendor.onMounted(() => {
|
|
||||||
init();
|
|
||||||
});
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return {
|
|
||||||
a: common_vendor.o(($event) => common_vendor.unref(utils_helper.navigateTo)("/pages/config/goodsAdd")),
|
|
||||||
b: common_vendor.p({
|
|
||||||
type: "primary",
|
|
||||||
block: true,
|
|
||||||
plain: true
|
|
||||||
}),
|
|
||||||
c: common_vendor.s("top:0px"),
|
|
||||||
d: common_vendor.f(dataList.value, (item, index, i0) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: getImg(item),
|
|
||||||
b: common_vendor.o(($event) => common_vendor.unref(utils_helper.navigateTo)("/pages/config/goodsDetail?id=" + item.goods_id), index),
|
|
||||||
c: common_vendor.t(item.degree.degree_name),
|
|
||||||
d: "d044a737-2-" + i0 + ",d044a737-0",
|
|
||||||
e: common_vendor.t(item.goods_name),
|
|
||||||
f: common_vendor.t(item.content),
|
|
||||||
g: common_vendor.t(item.goods_price),
|
|
||||||
h: common_vendor.t(item.status.text),
|
|
||||||
i: item.status.value == 10 || item.status.value == 20
|
|
||||||
}, item.status.value == 10 || item.status.value == 20 ? {
|
|
||||||
j: common_vendor.o(($event) => common_vendor.unref(utils_helper.navigateTo)("/pages/config/goodsEdit?id=" + item.goods_id), index),
|
|
||||||
k: "d044a737-3-" + i0 + ",d044a737-0",
|
|
||||||
l: common_vendor.p({
|
|
||||||
size: "small",
|
|
||||||
type: "primary"
|
|
||||||
})
|
|
||||||
} : {}, {
|
|
||||||
m: item.status.value == 40
|
|
||||||
}, item.status.value == 40 ? {
|
|
||||||
n: common_vendor.o(($event) => common_vendor.unref(utils_helper.navigateTo)("/pages/config/goodsEdit?id=" + item.goods_id), index),
|
|
||||||
o: "d044a737-4-" + i0 + ",d044a737-0",
|
|
||||||
p: common_vendor.p({
|
|
||||||
size: "small",
|
|
||||||
type: "primary"
|
|
||||||
})
|
|
||||||
} : {}, {
|
|
||||||
q: index
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
e: common_vendor.p({
|
|
||||||
["custom-color"]: "#1a1a1a"
|
|
||||||
}),
|
|
||||||
f: common_vendor.sr(paging, "d044a737-0", {
|
|
||||||
"k": "paging"
|
|
||||||
}),
|
|
||||||
g: common_vendor.o(queryList),
|
|
||||||
h: common_vendor.o(($event) => dataList.value = $event),
|
|
||||||
i: common_vendor.p({
|
|
||||||
["refresher-enabled"]: false,
|
|
||||||
["auto-clean-list-when-reload"]: false,
|
|
||||||
["auto-scroll-to-top-when-reload"]: false,
|
|
||||||
modelValue: dataList.value
|
|
||||||
})
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-d044a737"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/config/goodsList.js.map
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "商品管理",
|
|
||||||
"enablePullDownRefresh": false,
|
|
||||||
"usingComponents": {
|
|
||||||
"nut-button": "../../uni_modules/nutui-uni/components/button/button",
|
|
||||||
"nut-tag": "../../uni_modules/nutui-uni/components/tag/tag",
|
|
||||||
"z-paging": "../../uni_modules/z-paging/components/z-paging/z-paging"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<view class="page-content data-v-d044a737"><z-paging wx:if="{{i}}" class="r data-v-d044a737" u-s="{{['d']}}" u-r="paging" bindquery="{{g}}" u-i="d044a737-0" bind:__l="__l" bindupdateModelValue="{{h}}" u-p="{{i}}"><view class="data-v-d044a737" style="{{'z-index:10000;position:sticky' + ';' + c}}"><view class="top-bar data-v-d044a737"><nut-button wx:if="{{b}}" class="data-v-d044a737" u-s="{{['d']}}" bindclick="{{a}}" u-i="d044a737-1,d044a737-0" bind:__l="__l" u-p="{{b}}"> 新增订单 </nut-button></view></view><view wx:for="{{d}}" wx:for-item="item" wx:key="q" class="goods-item data-v-d044a737"><view class="goods-item-image data-v-d044a737"><image class="goods-item-image-img data-v-d044a737" src="{{item.a}}" bindtap="{{item.b}}" mode="scaleToFill"></image></view><view class="goods-item-content data-v-d044a737"><view class="goods-item-content-header data-v-d044a737"><nut-tag wx:if="{{e}}" class="data-v-d044a737" u-s="{{['d']}}" u-i="{{item.d}}" bind:__l="__l" u-p="{{e}}">{{item.c}}</nut-tag><view class="data-v-d044a737">{{item.e}}</view></view><view class="goods-item-content-body data-v-d044a737"><view class="goods-item-content-body-desc data-v-d044a737">{{item.f}}</view></view><view class="goods-item-content-footer data-v-d044a737"><view class="data-v-d044a737" style="font-size:24rpx;color:red"><text class="data-v-d044a737">¥{{item.g}}</text></view><view class="data-v-d044a737" style="font-size:24rpx"> 状态:<text class="data-v-d044a737">{{item.h}}</text></view><view class="goods-item-content-footer-btn data-v-d044a737"><nut-button wx:if="{{item.i}}" class="data-v-d044a737" u-s="{{['d']}}" bindclick="{{item.j}}" u-i="{{item.k}}" bind:__l="__l" u-p="{{item.l}}"> 编辑商品 </nut-button><nut-button wx:if="{{item.m}}" class="data-v-d044a737" u-s="{{['d']}}" bindclick="{{item.n}}" u-i="{{item.o}}" bind:__l="__l" u-p="{{item.p}}"> 售后(重新上架) </nut-button></view></view></view></view></z-paging></view>
|
|
||||||
@@ -1,312 +0,0 @@
|
|||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
.page-content.data-v-d044a737 {
|
|
||||||
min-height: 100vh;
|
|
||||||
background-color: #f2f3f5;
|
|
||||||
--nut-menu-bar-box-shadow: none;
|
|
||||||
--nut-menu-item-content-padding: 20rpx;
|
|
||||||
--nut-menu-item-content-max-height: 900rpx;
|
|
||||||
--nut-searchbar-input-height: 40px;
|
|
||||||
}
|
|
||||||
.data-v-d044a737 .titleClass .nut-menu__title-text {
|
|
||||||
font-size: 30rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
color: black;
|
|
||||||
}
|
|
||||||
.top-bar.data-v-d044a737 {
|
|
||||||
background: #fff;
|
|
||||||
align-items: center;
|
|
||||||
text-align: center;
|
|
||||||
padding: 20rpx 60rpx;
|
|
||||||
}
|
|
||||||
.goods-item.data-v-d044a737 {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
padding: 20rpx;
|
|
||||||
background-color: #ffffff;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
gap: 20rpx;
|
|
||||||
}
|
|
||||||
.goods-item .goods-item-image.data-v-d044a737 {
|
|
||||||
width: 180rpx;
|
|
||||||
height: 180rpx;
|
|
||||||
}
|
|
||||||
.goods-item .goods-item-image .goods-item-image-img.data-v-d044a737 {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
.goods-item .goods-item-content.data-v-d044a737 {
|
|
||||||
display: flex;
|
|
||||||
flex: 1;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: space-between;
|
|
||||||
/* 首尾贴边,中间均分 */
|
|
||||||
}
|
|
||||||
.goods-item .goods-item-content .goods-item-content-header.data-v-d044a737 {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
padding: 6rpx 0;
|
|
||||||
gap: 20rpx;
|
|
||||||
}
|
|
||||||
.goods-item .goods-item-content .goods-item-content-body.data-v-d044a737 {
|
|
||||||
padding: 6rpx 0;
|
|
||||||
}
|
|
||||||
.goods-item .goods-item-content .goods-item-content-body .goods-item-content-body-desc.data-v-d044a737 {
|
|
||||||
color: #7c7c7c;
|
|
||||||
font-size: 26rpx;
|
|
||||||
/* 关键属性 */
|
|
||||||
display: -webkit-box;
|
|
||||||
/* 使用弹性盒子布局 */
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
/* 垂直方向排列 */
|
|
||||||
-webkit-line-clamp: 2;
|
|
||||||
/* 限制显示两行 */
|
|
||||||
overflow: hidden;
|
|
||||||
/* 超出部分隐藏 */
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
/* 超出时显示省略号 */
|
|
||||||
}
|
|
||||||
.goods-item .goods-item-content .goods-item-content-stock.data-v-d044a737 {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
.goods-item .goods-item-content .goods-item-content-stock .goods-item-content-stock-desc.data-v-d044a737 {
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #999999;
|
|
||||||
}
|
|
||||||
.goods-item .goods-item-content .goods-item-content-stock .goods-item-content-status-desc.data-v-d044a737 {
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: red;
|
|
||||||
}
|
|
||||||
.goods-item .goods-item-content .goods-item-content-footer.data-v-d044a737 {
|
|
||||||
padding: 6rpx 0;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.goods-item .goods-item-content .goods-item-content-footer .goods-item-content-footer-btn.data-v-d044a737 {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
gap: 10rpx;
|
|
||||||
}
|
|
||||||
.goods-item .goods-item-content .goods-item-content-footer .goods-item-content-footer-btn .share-btn.data-v-d044a737 {
|
|
||||||
border-radius: 50rpx;
|
|
||||||
border: 2rpx solid red;
|
|
||||||
font-size: 26rpx;
|
|
||||||
align-items: center;
|
|
||||||
height: 54rpx;
|
|
||||||
color: red;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
.filter-types.data-v-d044a737 {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-start;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
overflow: auto;
|
|
||||||
gap: 10rpx;
|
|
||||||
padding: 10rpx;
|
|
||||||
height: 60rpx;
|
|
||||||
background-color: #fff;
|
|
||||||
border-bottom: 2rpx solid gainsboro;
|
|
||||||
border-top: 2rpx solid gainsboro;
|
|
||||||
}
|
|
||||||
.filter-types .filter-type-inner.data-v-d044a737 {
|
|
||||||
align-items: center;
|
|
||||||
background-color: rgba(0, 0, 0, 0.05);
|
|
||||||
border-radius: 16rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
display: flex;
|
|
||||||
flex: 0 0 auto;
|
|
||||||
font-size: 28rpx;
|
|
||||||
gap: 15rpx;
|
|
||||||
padding: 10rpx 20rpx;
|
|
||||||
}
|
|
||||||
.filter-types .filter-type-inner.active.data-v-d044a737 {
|
|
||||||
background-color: rgba(250, 44, 25, 0.1);
|
|
||||||
color: var(--nutui-color-primary);
|
|
||||||
}
|
|
||||||
.tabs-container.data-v-d044a737 {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
.tabs-container .tab-pane-inner.data-v-d044a737 {
|
|
||||||
height: 600rpx;
|
|
||||||
}
|
|
||||||
.tabs-container .tabs-inner.data-v-d044a737 {
|
|
||||||
overflow-y: scroll;
|
|
||||||
height: 600rpx;
|
|
||||||
width: 160rpx;
|
|
||||||
background-color: #F5F5F5;
|
|
||||||
}
|
|
||||||
.tabs-container .tabs-inner .tab-inner.data-v-d044a737 {
|
|
||||||
display: flex;
|
|
||||||
height: 60rpx;
|
|
||||||
padding: 10rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
background: #F5F5F5;
|
|
||||||
}
|
|
||||||
.tabs-container .tabs-inner .tab-inner text.data-v-d044a737 {
|
|
||||||
width: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.tabs-container .tabs-inner .tab-inner-active.data-v-d044a737 {
|
|
||||||
background-color: rgba(250, 44, 25, 0.1);
|
|
||||||
color: var(--nutui-color-primary);
|
|
||||||
}
|
|
||||||
.degree-inner.data-v-d044a737 {
|
|
||||||
display: flex;
|
|
||||||
flex: 1;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 10rpx;
|
|
||||||
width: 100%;
|
|
||||||
margin-bottom: 60rpx;
|
|
||||||
}
|
|
||||||
.degree-item.data-v-d044a737 {
|
|
||||||
align-items: center;
|
|
||||||
background-color: rgba(0, 0, 0, 0.05);
|
|
||||||
border-radius: 10rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
display: flex;
|
|
||||||
flex: 0 0 auto;
|
|
||||||
font-size: 26rpx;
|
|
||||||
gap: 10rpx;
|
|
||||||
justify-content: center;
|
|
||||||
min-height: 80rpx;
|
|
||||||
width: calc(50% - 10rpx);
|
|
||||||
}
|
|
||||||
.degree-item.active.data-v-d044a737 {
|
|
||||||
background-color: rgba(250, 44, 25, 0.1);
|
|
||||||
color: var(--nutui-color-primary);
|
|
||||||
}
|
|
||||||
.product-btns.data-v-d044a737 {
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
padding: 20rpx 0;
|
|
||||||
}
|
|
||||||
.product-btns .reset.data-v-d044a737 {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
.product-btns .confirm.data-v-d044a737 {
|
|
||||||
flex: 2;
|
|
||||||
}
|
|
||||||
.degree-btns.data-v-d044a737 {
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.degree-btns .reset.data-v-d044a737 {
|
|
||||||
flex: 1;
|
|
||||||
/* 重置按钮占 1 份 */
|
|
||||||
}
|
|
||||||
.degree-btns .confirm.data-v-d044a737 {
|
|
||||||
flex: 2;
|
|
||||||
/* 确认按钮占 2 份 */
|
|
||||||
}
|
|
||||||
.main-nav-container.data-v-d044a737 {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
background-color: #fff;
|
|
||||||
padding: 20rpx;
|
|
||||||
}
|
|
||||||
.nav-button.data-v-d044a737 {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
width: 45%;
|
|
||||||
height: 160rpx;
|
|
||||||
border-radius: 20rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
padding: 0 10rpx;
|
|
||||||
}
|
|
||||||
.phone-button.data-v-d044a737 {
|
|
||||||
background: linear-gradient(135deg, #6a5ae0, #8d7bfb);
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
.parts-button.data-v-d044a737 {
|
|
||||||
background: linear-gradient(135deg, #ff6b6b, #ee5253);
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
.nav-button-bg.data-v-d044a737 {
|
|
||||||
position: absolute;
|
|
||||||
right: 0;
|
|
||||||
top: 0;
|
|
||||||
height: 100%;
|
|
||||||
width: 50%;
|
|
||||||
opacity: 0.2;
|
|
||||||
object-fit: cover;
|
|
||||||
}
|
|
||||||
.nav-button-icon.data-v-d044a737 {
|
|
||||||
width: 90rpx;
|
|
||||||
height: 90rpx;
|
|
||||||
margin-right: 20rpx;
|
|
||||||
z-index: 2;
|
|
||||||
}
|
|
||||||
.nav-button-content.data-v-d044a737 {
|
|
||||||
z-index: 2;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
.nav-button-title.data-v-d044a737 {
|
|
||||||
font-size: 34rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-bottom: 8rpx;
|
|
||||||
}
|
|
||||||
.nav-button-desc.data-v-d044a737 {
|
|
||||||
font-size: 24rpx;
|
|
||||||
opacity: 0.85;
|
|
||||||
}
|
|
||||||
691
unpackage/dist/dev/mp-weixin/pages/config/price.js
vendored
691
unpackage/dist/dev/mp-weixin/pages/config/price.js
vendored
@@ -1,691 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
const api_config = require("../../api/config.js");
|
|
||||||
const api_house_goods = require("../../api/house_goods.js");
|
|
||||||
if (!Array) {
|
|
||||||
const _easycom_z_tabs2 = common_vendor.resolveComponent("z-tabs");
|
|
||||||
const _easycom_nut_noticebar2 = common_vendor.resolveComponent("nut-noticebar");
|
|
||||||
const _easycom_nut_button2 = common_vendor.resolveComponent("nut-button");
|
|
||||||
const _easycom_nut_input2 = common_vendor.resolveComponent("nut-input");
|
|
||||||
const _easycom_nut_radio2 = common_vendor.resolveComponent("nut-radio");
|
|
||||||
const _easycom_nut_radio_group2 = common_vendor.resolveComponent("nut-radio-group");
|
|
||||||
const _easycom_nut_menu_item2 = common_vendor.resolveComponent("nut-menu-item");
|
|
||||||
const _easycom_nut_menu2 = common_vendor.resolveComponent("nut-menu");
|
|
||||||
const _easycom_nut_tag2 = common_vendor.resolveComponent("nut-tag");
|
|
||||||
const _easycom_z_paging2 = common_vendor.resolveComponent("z-paging");
|
|
||||||
const _easycom_nut_popup2 = common_vendor.resolveComponent("nut-popup");
|
|
||||||
const _easycom_nut_switch2 = common_vendor.resolveComponent("nut-switch");
|
|
||||||
const _easycom_nut_cell2 = common_vendor.resolveComponent("nut-cell");
|
|
||||||
(_easycom_z_tabs2 + _easycom_nut_noticebar2 + _easycom_nut_button2 + _easycom_nut_input2 + _easycom_nut_radio2 + _easycom_nut_radio_group2 + _easycom_nut_menu_item2 + _easycom_nut_menu2 + _easycom_nut_tag2 + _easycom_z_paging2 + _easycom_nut_popup2 + _easycom_nut_switch2 + _easycom_nut_cell2)();
|
|
||||||
}
|
|
||||||
const _easycom_z_tabs = () => "../../uni_modules/z-tabs/components/z-tabs/z-tabs.js";
|
|
||||||
const _easycom_nut_noticebar = () => "../../uni_modules/nutui-uni/components/noticebar/noticebar.js";
|
|
||||||
const _easycom_nut_button = () => "../../uni_modules/nutui-uni/components/button/button.js";
|
|
||||||
const _easycom_nut_input = () => "../../uni_modules/nutui-uni/components/input/input.js";
|
|
||||||
const _easycom_nut_radio = () => "../../uni_modules/nutui-uni/components/radio/radio.js";
|
|
||||||
const _easycom_nut_radio_group = () => "../../uni_modules/nutui-uni/components/radiogroup/radiogroup.js";
|
|
||||||
const _easycom_nut_menu_item = () => "../../uni_modules/nutui-uni/components/menuitem/menuitem.js";
|
|
||||||
const _easycom_nut_menu = () => "../../uni_modules/nutui-uni/components/menu/menu.js";
|
|
||||||
const _easycom_nut_tag = () => "../../uni_modules/nutui-uni/components/tag/tag.js";
|
|
||||||
const _easycom_z_paging = () => "../../uni_modules/z-paging/components/z-paging/z-paging.js";
|
|
||||||
const _easycom_nut_popup = () => "../../uni_modules/nutui-uni/components/popup/popup.js";
|
|
||||||
const _easycom_nut_switch = () => "../../uni_modules/nutui-uni/components/switch/switch.js";
|
|
||||||
const _easycom_nut_cell = () => "../../uni_modules/nutui-uni/components/cell/cell.js";
|
|
||||||
if (!Math) {
|
|
||||||
(_easycom_z_tabs + _easycom_nut_noticebar + _easycom_nut_button + _easycom_nut_input + _easycom_nut_radio + _easycom_nut_radio_group + _easycom_nut_menu_item + _easycom_nut_menu + _easycom_nut_tag + _easycom_z_paging + _easycom_nut_popup + _easycom_nut_switch + _easycom_nut_cell)();
|
|
||||||
}
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "price",
|
|
||||||
setup(__props) {
|
|
||||||
common_vendor.onLoad((options) => {
|
|
||||||
});
|
|
||||||
const getImg = (goods) => {
|
|
||||||
var _a, _b, _c;
|
|
||||||
const url = (_c = (_b = (_a = goods == null ? void 0 : goods.goods_house) == null ? void 0 : _a.image) == null ? void 0 : _b[0]) == null ? void 0 : _c.file_path;
|
|
||||||
return url ? url + "?imageView2/1/w/200/h/200" : "";
|
|
||||||
};
|
|
||||||
const getConfig = () => {
|
|
||||||
api_config.fetchGetConfig().then((res) => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/price.vue:329", "getConfig=====>", res);
|
|
||||||
isWarehouse.value = res.appConfig.is_warehouse == 1;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const setConfig = () => {
|
|
||||||
let form = {
|
|
||||||
is_warehouse: Number(isWarehouse.value)
|
|
||||||
};
|
|
||||||
api_config.fetchSetConfig(form).then((res) => {
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
icon: "none",
|
|
||||||
title: "操作成功"
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const getPrice = (goods) => {
|
|
||||||
const list = singleRule.value || singleRule;
|
|
||||||
const rule = list.find((item) => item.product_id === goods.goods_id);
|
|
||||||
if (!rule) {
|
|
||||||
return "未单独设置";
|
|
||||||
}
|
|
||||||
const basePrice = Number(goods.goods_price);
|
|
||||||
const val = Number(rule.val);
|
|
||||||
let finalPrice = basePrice;
|
|
||||||
if (rule.val_type == 1) {
|
|
||||||
finalPrice = basePrice + val;
|
|
||||||
} else if (rule.val_type == 2) {
|
|
||||||
finalPrice = basePrice + basePrice * val / 100;
|
|
||||||
}
|
|
||||||
return finalPrice.toFixed(2);
|
|
||||||
};
|
|
||||||
const paging = common_vendor.ref(null);
|
|
||||||
const dataList = common_vendor.ref([]);
|
|
||||||
const user_goods_cart_ids = common_vendor.ref([]);
|
|
||||||
const goods_cart_ids = common_vendor.ref([]);
|
|
||||||
const selectPriceSortRef = common_vendor.ref(null);
|
|
||||||
const selectDegreeRef = common_vendor.ref(null);
|
|
||||||
const selectProductRef = common_vendor.ref(null);
|
|
||||||
const state = common_vendor.reactive({
|
|
||||||
type_params: [],
|
|
||||||
// 产品类型
|
|
||||||
drop_down_options: [],
|
|
||||||
// 产品类型下的品牌列表
|
|
||||||
o_drop_down_options: [],
|
|
||||||
// 价格排序
|
|
||||||
price_sort_params: [
|
|
||||||
{
|
|
||||||
text: "默认排序",
|
|
||||||
value: ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: "价格升序",
|
|
||||||
value: "ascend"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: "价格降序",
|
|
||||||
value: "descend"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
// 成色所有选项
|
|
||||||
degree_params: [],
|
|
||||||
price_sort: "",
|
|
||||||
price_sort_name: "默认排序",
|
|
||||||
degree_ids: [],
|
|
||||||
degree_name: "成色",
|
|
||||||
product_name: "机型",
|
|
||||||
type_id: 1,
|
|
||||||
// 产品类型id 默认 1 手机
|
|
||||||
type_name: "手机",
|
|
||||||
brand_id: 0,
|
|
||||||
// 品牌id // 默认 0 全部
|
|
||||||
brand_name: "全部",
|
|
||||||
product_ids: [0]
|
|
||||||
// 机型ids 默认 0 全部
|
|
||||||
// search_val: '', // 搜索
|
|
||||||
});
|
|
||||||
const onResetProduct = () => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/price.vue:427", "重置产品");
|
|
||||||
state.type_id = 1;
|
|
||||||
state.type_name = "手机";
|
|
||||||
state.brand_id = 0;
|
|
||||||
state.brand_name = "全部";
|
|
||||||
state.product_ids = [0];
|
|
||||||
state.product_name = "机型";
|
|
||||||
};
|
|
||||||
const onConfirmProduct = () => {
|
|
||||||
var _a;
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/price.vue:438", "当前产品类型", {
|
|
||||||
"type_id": state.type_id,
|
|
||||||
"type_name": state.type_name,
|
|
||||||
"brand_id": state.brand_id,
|
|
||||||
"brand_name": state.brand_name,
|
|
||||||
"product_ids": state.product_ids
|
|
||||||
});
|
|
||||||
(_a = selectProductRef.value) == null ? void 0 : _a.toggle(false);
|
|
||||||
paging.value.reload();
|
|
||||||
};
|
|
||||||
const selectProduct = (product) => {
|
|
||||||
if (product.value === 0) {
|
|
||||||
state.product_ids = [0];
|
|
||||||
} else {
|
|
||||||
state.product_ids = state.product_ids.filter((e) => e != 0);
|
|
||||||
const index = state.product_ids.indexOf(product.value);
|
|
||||||
if (index > -1) {
|
|
||||||
state.product_ids.splice(index, 1);
|
|
||||||
if (state.product_ids.length === 0) {
|
|
||||||
state.product_ids = [0];
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
state.product_ids.push(product.value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/price.vue:466", product);
|
|
||||||
};
|
|
||||||
const productOptions = common_vendor.computed(() => {
|
|
||||||
var _a;
|
|
||||||
return (_a = state == null ? void 0 : state.o_drop_down_options[state.type_id]) == null ? void 0 : _a.children[state.brand_id].children;
|
|
||||||
});
|
|
||||||
const selectBrand = (brand) => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/price.vue:475", brand);
|
|
||||||
state.brand_id = brand.value;
|
|
||||||
state.brand_name = brand.label;
|
|
||||||
state.product_ids = [0];
|
|
||||||
state.product_name = brand.label;
|
|
||||||
};
|
|
||||||
const selectType = (type) => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/price.vue:487", type);
|
|
||||||
state.type_id = type.type_id;
|
|
||||||
state.type_name = type.name;
|
|
||||||
state.brand_id = 0;
|
|
||||||
state.brand_name = "全部";
|
|
||||||
state.product_ids = [0];
|
|
||||||
};
|
|
||||||
const selectPriceSort = (item) => {
|
|
||||||
var _a;
|
|
||||||
if (state.price_sort !== item.value) {
|
|
||||||
state.price_sort = item.value;
|
|
||||||
state.price_sort_name = item.text;
|
|
||||||
} else {
|
|
||||||
state.price_sort_name = "默认排序";
|
|
||||||
state.price_sort = "";
|
|
||||||
}
|
|
||||||
(_a = selectPriceSortRef.value) == null ? void 0 : _a.toggle(false);
|
|
||||||
paging.value.reload();
|
|
||||||
};
|
|
||||||
const selectDegree = (item) => {
|
|
||||||
const index = state.degree_ids.indexOf(item.value);
|
|
||||||
if (index > -1) {
|
|
||||||
state.degree_ids.splice(index, 1);
|
|
||||||
} else {
|
|
||||||
state.degree_ids.push(item.value);
|
|
||||||
}
|
|
||||||
if (state.degree_ids.length > 0) {
|
|
||||||
state.degree_name = "已选" + state.degree_ids.length.toString() + "项";
|
|
||||||
} else {
|
|
||||||
state.degree_name = "成色";
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const onResetDegree = () => {
|
|
||||||
var _a;
|
|
||||||
state.degree_ids = [];
|
|
||||||
state.degree_name = "成色";
|
|
||||||
(_a = selectDegreeRef.value) == null ? void 0 : _a.toggle(false);
|
|
||||||
paging.value.reload();
|
|
||||||
};
|
|
||||||
const onConfirmDegree = () => {
|
|
||||||
var _a;
|
|
||||||
if (state.degree_ids.length > 0) {
|
|
||||||
state.degree_name = "已选" + state.degree_ids.length.toString() + "项";
|
|
||||||
} else {
|
|
||||||
state.degree_name = "成色";
|
|
||||||
}
|
|
||||||
(_a = selectDegreeRef.value) == null ? void 0 : _a.toggle(false);
|
|
||||||
paging.value.reload();
|
|
||||||
};
|
|
||||||
const queryList = (pageNo, pageSize) => {
|
|
||||||
const params = {
|
|
||||||
pageSize,
|
|
||||||
page: pageNo,
|
|
||||||
price_sort: state.price_sort,
|
|
||||||
degree_ids: state.degree_ids,
|
|
||||||
type_id: state.type_id,
|
|
||||||
brand_id: state.brand_id,
|
|
||||||
product_ids: state.product_ids,
|
|
||||||
search: state.search_val
|
|
||||||
};
|
|
||||||
api_house_goods.houseFetchGoodsList(params).then((res) => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/price.vue:561", res);
|
|
||||||
paging.value.complete(res.list);
|
|
||||||
user_goods_cart_ids.value = res.user_cart_goods_ids;
|
|
||||||
goods_cart_ids.value = res.cart_goods_ids;
|
|
||||||
}).catch((res) => {
|
|
||||||
paging.value.complete(false);
|
|
||||||
user_goods_cart_ids.value = [];
|
|
||||||
goods_cart_ids.value = [];
|
|
||||||
});
|
|
||||||
};
|
|
||||||
common_vendor.onMounted(() => {
|
|
||||||
init();
|
|
||||||
});
|
|
||||||
const init = () => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/price.vue:587", "init");
|
|
||||||
getConfig();
|
|
||||||
api_config.fetchGetPriceRules().then((res) => {
|
|
||||||
var _a;
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/price.vue:594", "res", res);
|
|
||||||
rangeRule.value = (res == null ? void 0 : res.range) ?? [];
|
|
||||||
singleRule.value = (res == null ? void 0 : res.single) ?? [];
|
|
||||||
Object.assign(warehouseRule, ((_a = res == null ? void 0 : res.warehouse) == null ? void 0 : _a[0]) ?? {
|
|
||||||
val: "",
|
|
||||||
val_type: 1
|
|
||||||
});
|
|
||||||
});
|
|
||||||
api_house_goods.houseFetchFilterParmas().then((res) => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/price.vue:609", res);
|
|
||||||
let degree_params = res.degree_list;
|
|
||||||
state.degree_params = degree_params.reduce((it, cit) => {
|
|
||||||
it.push({
|
|
||||||
text: cit.degree_name,
|
|
||||||
value: cit.degree_id
|
|
||||||
});
|
|
||||||
return it;
|
|
||||||
}, state.degree_params) || [];
|
|
||||||
state.type_params = res.type_list;
|
|
||||||
state.drop_down_options = res.drop_down_options;
|
|
||||||
state.o_drop_down_options = res.o_drop_down_options;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const showGoodsImages = (goods) => {
|
|
||||||
var _a;
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/price.vue:633", goods.goods_house);
|
|
||||||
common_vendor.index.previewImage({
|
|
||||||
// current: index, // 指定当前显示的图片索引
|
|
||||||
urls: (_a = goods == null ? void 0 : goods.goods_house) == null ? void 0 : _a.image.map((e) => {
|
|
||||||
return e.file_path;
|
|
||||||
})
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const tabList = common_vendor.ref(["区间调价", "单机调价", "整仓调价"]);
|
|
||||||
const tabIndex = common_vendor.ref(0);
|
|
||||||
const tabsChange = (index) => {
|
|
||||||
tabIndex.value = index;
|
|
||||||
};
|
|
||||||
const isWarehouse = common_vendor.ref(false);
|
|
||||||
const warehouseRule = common_vendor.reactive({
|
|
||||||
val: "",
|
|
||||||
val_type: 1
|
|
||||||
});
|
|
||||||
const onIsWarehouseChange = (val) => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/price.vue:667", isWarehouse.value);
|
|
||||||
setConfig();
|
|
||||||
};
|
|
||||||
const saveWarehouseRule = () => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/price.vue:673", warehouseRule);
|
|
||||||
let data = {
|
|
||||||
warehouseRule: {
|
|
||||||
...warehouseRule
|
|
||||||
}
|
|
||||||
};
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/price.vue:679", data);
|
|
||||||
submit(data, 3);
|
|
||||||
};
|
|
||||||
const singleRule = common_vendor.ref([]);
|
|
||||||
const tempSingleRule = common_vendor.reactive({
|
|
||||||
val: "",
|
|
||||||
val_type: 1,
|
|
||||||
product_id: 0
|
|
||||||
});
|
|
||||||
const showEdit = common_vendor.ref(false);
|
|
||||||
const detail = common_vendor.reactive({});
|
|
||||||
const onEdit = (goods) => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/price.vue:698", "----", goods);
|
|
||||||
Object.assign(detail, goods);
|
|
||||||
showEdit.value = true;
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/price.vue:701", "----", detail.value);
|
|
||||||
};
|
|
||||||
const onClosePopup = () => {
|
|
||||||
Object.assign(detail, {});
|
|
||||||
Object.assign(tempSingleRule, {
|
|
||||||
val: "",
|
|
||||||
val_type: 1,
|
|
||||||
product_id: 0
|
|
||||||
});
|
|
||||||
showEdit.value = false;
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/price.vue:712", "关闭");
|
|
||||||
};
|
|
||||||
const saveSingleRule = () => {
|
|
||||||
tempSingleRule.product_id = detail.goods_id;
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/price.vue:719", "tempSingleRule.value", tempSingleRule);
|
|
||||||
let data = {
|
|
||||||
singleRule: {
|
|
||||||
...tempSingleRule
|
|
||||||
}
|
|
||||||
};
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/price.vue:725", data);
|
|
||||||
submit(data, 2);
|
|
||||||
};
|
|
||||||
const rangeRule = common_vendor.ref([]);
|
|
||||||
const addRule = () => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/price.vue:735", rangeRule.value);
|
|
||||||
rangeRule.value.unshift({
|
|
||||||
min_price: "",
|
|
||||||
max_price: "",
|
|
||||||
val: "",
|
|
||||||
val_type: 1
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const removeRule = (index) => {
|
|
||||||
rangeRule.value.splice(index, 1);
|
|
||||||
};
|
|
||||||
const saveRangeRule = () => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/price.vue:749", rangeRule.value);
|
|
||||||
let data = {
|
|
||||||
rangeRule: rangeRule.value
|
|
||||||
};
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/price.vue:753", data);
|
|
||||||
submit(data, 1);
|
|
||||||
};
|
|
||||||
const submit = (data, type) => {
|
|
||||||
api_config.fetchSetPriceRules(data).then((res) => {
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
icon: "none",
|
|
||||||
title: "规则配置成功"
|
|
||||||
});
|
|
||||||
api_config.fetchGetPriceRules().then((res2) => {
|
|
||||||
var _a;
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/price.vue:767", "res", res2);
|
|
||||||
rangeRule.value = (res2 == null ? void 0 : res2.range) ?? [];
|
|
||||||
singleRule.value = (res2 == null ? void 0 : res2.single) ?? [];
|
|
||||||
Object.assign(warehouseRule, ((_a = res2 == null ? void 0 : res2.warehouse) == null ? void 0 : _a[0]) ?? {
|
|
||||||
val: "",
|
|
||||||
val_type: 1
|
|
||||||
});
|
|
||||||
if (type == 2) {
|
|
||||||
onClosePopup();
|
|
||||||
paging.value.refresh();
|
|
||||||
}
|
|
||||||
if (type == 3) {
|
|
||||||
getConfig();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
var _a, _b, _c, _d, _e, _f;
|
|
||||||
return common_vendor.e({
|
|
||||||
a: common_vendor.o(tabsChange),
|
|
||||||
b: common_vendor.p({
|
|
||||||
list: tabList.value,
|
|
||||||
["active-color"]: "rgba(233, 100, 67, 1)"
|
|
||||||
}),
|
|
||||||
c: tabIndex.value == 0
|
|
||||||
}, tabIndex.value == 0 ? {
|
|
||||||
d: common_vendor.p({
|
|
||||||
text: "区间调价:可以针对价格区间进行批量固定加价,或者按照原价的百分比加价",
|
|
||||||
background: `rgba(251, 248, 220, 1)`,
|
|
||||||
["custom-color"]: `#D9500B`
|
|
||||||
})
|
|
||||||
} : {}, {
|
|
||||||
e: tabIndex.value == 1
|
|
||||||
}, tabIndex.value == 1 ? {
|
|
||||||
f: common_vendor.p({
|
|
||||||
text: "单机调价:针对某款机器进行固定加价,或者按照原价的百分比加价",
|
|
||||||
background: `rgba(251, 248, 220, 1)`,
|
|
||||||
["custom-color"]: `#D9500B`
|
|
||||||
})
|
|
||||||
} : {}, {
|
|
||||||
g: tabIndex.value == 2
|
|
||||||
}, tabIndex.value == 2 ? {
|
|
||||||
h: common_vendor.p({
|
|
||||||
text: "整仓调价:针对整个仓库进行固定加价,或者按照原价的百分比加价",
|
|
||||||
background: `rgba(251, 248, 220, 1)`,
|
|
||||||
["custom-color"]: `#D9500B`
|
|
||||||
})
|
|
||||||
} : {}, {
|
|
||||||
i: tabIndex.value == 0
|
|
||||||
}, tabIndex.value == 0 ? {
|
|
||||||
j: common_vendor.o(addRule),
|
|
||||||
k: common_vendor.p({
|
|
||||||
type: "primary",
|
|
||||||
plain: true
|
|
||||||
}),
|
|
||||||
l: common_vendor.o(saveRangeRule),
|
|
||||||
m: common_vendor.p({
|
|
||||||
type: "primary"
|
|
||||||
}),
|
|
||||||
n: common_vendor.f(rangeRule.value, (item, index, i0) => {
|
|
||||||
return {
|
|
||||||
a: "9320a8b3-6-" + i0,
|
|
||||||
b: common_vendor.o(($event) => item.min_price = $event, index),
|
|
||||||
c: common_vendor.p({
|
|
||||||
type: "number",
|
|
||||||
placeholder: "0",
|
|
||||||
["input-align"]: "right",
|
|
||||||
modelValue: item.min_price
|
|
||||||
}),
|
|
||||||
d: "9320a8b3-7-" + i0,
|
|
||||||
e: common_vendor.o(($event) => item.max_price = $event, index),
|
|
||||||
f: common_vendor.p({
|
|
||||||
type: "number",
|
|
||||||
placeholder: "0",
|
|
||||||
["input-align"]: "right",
|
|
||||||
modelValue: item.max_price
|
|
||||||
}),
|
|
||||||
g: "9320a8b3-8-" + i0,
|
|
||||||
h: common_vendor.o(($event) => item.val = $event, index),
|
|
||||||
i: common_vendor.p({
|
|
||||||
type: "number",
|
|
||||||
placeholder: "0",
|
|
||||||
["input-align"]: "right",
|
|
||||||
modelValue: item.val
|
|
||||||
}),
|
|
||||||
j: "9320a8b3-10-" + i0 + "," + ("9320a8b3-9-" + i0),
|
|
||||||
k: "9320a8b3-11-" + i0 + "," + ("9320a8b3-9-" + i0),
|
|
||||||
l: "9320a8b3-9-" + i0,
|
|
||||||
m: common_vendor.o(($event) => item.val_type = $event, index),
|
|
||||||
n: common_vendor.p({
|
|
||||||
direction: "horizontal",
|
|
||||||
modelValue: item.val_type
|
|
||||||
}),
|
|
||||||
o: common_vendor.o(($event) => removeRule(index), index),
|
|
||||||
p: "9320a8b3-12-" + i0,
|
|
||||||
q: index
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
o: common_vendor.p({
|
|
||||||
label: 1
|
|
||||||
}),
|
|
||||||
p: common_vendor.p({
|
|
||||||
label: 2
|
|
||||||
}),
|
|
||||||
q: common_vendor.p({
|
|
||||||
type: "danger",
|
|
||||||
size: "mini"
|
|
||||||
})
|
|
||||||
} : {}, {
|
|
||||||
r: tabIndex.value == 1
|
|
||||||
}, tabIndex.value == 1 ? {
|
|
||||||
s: common_vendor.f(state.price_sort_params, (item, idx, i0) => {
|
|
||||||
return {
|
|
||||||
a: common_vendor.t(item.text),
|
|
||||||
b: state.price_sort === item.value ? 1 : "",
|
|
||||||
c: idx,
|
|
||||||
d: common_vendor.o(($event) => selectPriceSort(item), idx)
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
t: common_vendor.sr(selectPriceSortRef, "9320a8b3-14,9320a8b3-13", {
|
|
||||||
"k": "selectPriceSortRef"
|
|
||||||
}),
|
|
||||||
v: common_vendor.p({
|
|
||||||
title: state.price_sort_name
|
|
||||||
}),
|
|
||||||
w: common_vendor.f(state.type_params, (type, idx, i0) => {
|
|
||||||
return {
|
|
||||||
a: common_vendor.t(type.name),
|
|
||||||
b: idx,
|
|
||||||
c: common_vendor.o(($event) => selectType(type), idx),
|
|
||||||
d: state.type_id == type.type_id ? 1 : ""
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
x: common_vendor.f((_a = state == null ? void 0 : state.drop_down_options[state.type_id]) == null ? void 0 : _a.children, (item, idx, i0) => {
|
|
||||||
return {
|
|
||||||
a: common_vendor.t(item.label),
|
|
||||||
b: idx,
|
|
||||||
c: common_vendor.o(($event) => selectBrand(item), idx),
|
|
||||||
d: item.value == state.brand_id ? 1 : ""
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
y: common_vendor.f(productOptions.value, (item, idx, i0) => {
|
|
||||||
return {
|
|
||||||
a: common_vendor.t(item.label),
|
|
||||||
b: idx,
|
|
||||||
c: state.product_ids.includes(item.value) ? 1 : "",
|
|
||||||
d: common_vendor.o(($event) => selectProduct(item), idx)
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
z: common_vendor.o(($event) => onResetProduct()),
|
|
||||||
A: common_vendor.p({
|
|
||||||
plain: true,
|
|
||||||
type: "default"
|
|
||||||
}),
|
|
||||||
B: common_vendor.o(($event) => onConfirmProduct()),
|
|
||||||
C: common_vendor.p({
|
|
||||||
block: true,
|
|
||||||
type: "primary"
|
|
||||||
}),
|
|
||||||
D: common_vendor.sr(selectProductRef, "9320a8b3-15,9320a8b3-13", {
|
|
||||||
"k": "selectProductRef"
|
|
||||||
}),
|
|
||||||
E: common_vendor.p({
|
|
||||||
title: state.product_name
|
|
||||||
}),
|
|
||||||
F: common_vendor.f(state.degree_params, (item, idx, i0) => {
|
|
||||||
return {
|
|
||||||
a: common_vendor.t(item.text),
|
|
||||||
b: state.degree_ids.includes(item.value) ? 1 : "",
|
|
||||||
c: idx,
|
|
||||||
d: common_vendor.o(($event) => selectDegree(item), idx)
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
G: common_vendor.o(($event) => onResetDegree()),
|
|
||||||
H: common_vendor.p({
|
|
||||||
plain: true,
|
|
||||||
type: "default"
|
|
||||||
}),
|
|
||||||
I: common_vendor.o(($event) => onConfirmDegree()),
|
|
||||||
J: common_vendor.p({
|
|
||||||
block: true,
|
|
||||||
type: "primary"
|
|
||||||
}),
|
|
||||||
K: common_vendor.sr(selectDegreeRef, "9320a8b3-18,9320a8b3-13", {
|
|
||||||
"k": "selectDegreeRef"
|
|
||||||
}),
|
|
||||||
L: common_vendor.p({
|
|
||||||
title: state.degree_name
|
|
||||||
}),
|
|
||||||
M: common_vendor.p({
|
|
||||||
["title-class"]: "titleClass"
|
|
||||||
}),
|
|
||||||
N: common_vendor.f(dataList.value, (item, index, i0) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: getImg(item),
|
|
||||||
b: common_vendor.o(($event) => showGoodsImages(item), index),
|
|
||||||
c: common_vendor.t(item.goods_house.degree.degree_name),
|
|
||||||
d: "9320a8b3-22-" + i0 + ",9320a8b3-21",
|
|
||||||
e: common_vendor.t(item.goods_house.goods_name),
|
|
||||||
f: common_vendor.t(item.goods_house.content),
|
|
||||||
g: common_vendor.t(item.goods_house.goods_price),
|
|
||||||
h: common_vendor.t(getPrice(item)),
|
|
||||||
i: !goods_cart_ids.value.includes(item.goods_id) && !user_goods_cart_ids.value.includes(item.goods_id)
|
|
||||||
}, !goods_cart_ids.value.includes(item.goods_id) && !user_goods_cart_ids.value.includes(item.goods_id) ? {
|
|
||||||
j: common_vendor.o(($event) => onEdit(item), index),
|
|
||||||
k: "9320a8b3-23-" + i0 + ",9320a8b3-21",
|
|
||||||
l: common_vendor.p({
|
|
||||||
size: "small",
|
|
||||||
type: "primary"
|
|
||||||
})
|
|
||||||
} : {
|
|
||||||
m: "9320a8b3-24-" + i0 + ",9320a8b3-21",
|
|
||||||
n: common_vendor.p({
|
|
||||||
size: "small",
|
|
||||||
plain: true
|
|
||||||
})
|
|
||||||
}, {
|
|
||||||
o: index
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
O: common_vendor.p({
|
|
||||||
["custom-color"]: "#1a1a1a"
|
|
||||||
}),
|
|
||||||
P: common_vendor.sr(paging, "9320a8b3-21", {
|
|
||||||
"k": "paging"
|
|
||||||
}),
|
|
||||||
Q: common_vendor.o(queryList),
|
|
||||||
R: common_vendor.o(($event) => dataList.value = $event),
|
|
||||||
S: common_vendor.p({
|
|
||||||
fixed: false,
|
|
||||||
["refresher-enabled"]: false,
|
|
||||||
["auto-clean-list-when-reload"]: false,
|
|
||||||
["auto-scroll-to-top-when-reload"]: false,
|
|
||||||
modelValue: dataList.value
|
|
||||||
})
|
|
||||||
} : {}, {
|
|
||||||
T: getImg(detail),
|
|
||||||
U: common_vendor.o(($event) => showGoodsImages(detail)),
|
|
||||||
V: common_vendor.t((_c = (_b = detail == null ? void 0 : detail.goods_house) == null ? void 0 : _b.degree) == null ? void 0 : _c.degree_name),
|
|
||||||
W: common_vendor.p({
|
|
||||||
["custom-color"]: "#1a1a1a"
|
|
||||||
}),
|
|
||||||
X: common_vendor.t((_d = detail == null ? void 0 : detail.goods_house) == null ? void 0 : _d.goods_name),
|
|
||||||
Y: common_vendor.t((_e = detail == null ? void 0 : detail.goods_house) == null ? void 0 : _e.content),
|
|
||||||
Z: common_vendor.t((_f = detail == null ? void 0 : detail.goods_house) == null ? void 0 : _f.goods_price),
|
|
||||||
aa: common_vendor.t(getPrice(detail)),
|
|
||||||
ab: common_vendor.o(($event) => tempSingleRule.val = $event),
|
|
||||||
ac: common_vendor.p({
|
|
||||||
type: "number",
|
|
||||||
placeholder: "0",
|
|
||||||
["input-align"]: "right",
|
|
||||||
modelValue: tempSingleRule.val
|
|
||||||
}),
|
|
||||||
ad: common_vendor.p({
|
|
||||||
label: 1
|
|
||||||
}),
|
|
||||||
ae: common_vendor.p({
|
|
||||||
label: 2
|
|
||||||
}),
|
|
||||||
af: common_vendor.o(($event) => tempSingleRule.val_type = $event),
|
|
||||||
ag: common_vendor.p({
|
|
||||||
direction: "horizontal",
|
|
||||||
modelValue: tempSingleRule.val_type
|
|
||||||
}),
|
|
||||||
ah: common_vendor.o(($event) => saveSingleRule()),
|
|
||||||
ai: common_vendor.p({
|
|
||||||
type: "primary",
|
|
||||||
block: true
|
|
||||||
}),
|
|
||||||
aj: common_vendor.o(onClosePopup),
|
|
||||||
ak: common_vendor.o(($event) => showEdit.value = $event),
|
|
||||||
al: common_vendor.p({
|
|
||||||
["custom-style"]: {
|
|
||||||
height: "45%"
|
|
||||||
},
|
|
||||||
position: "bottom",
|
|
||||||
["safe-area-inset-bottom"]: true,
|
|
||||||
visible: showEdit.value
|
|
||||||
}),
|
|
||||||
am: tabIndex.value == 2
|
|
||||||
}, tabIndex.value == 2 ? {
|
|
||||||
an: common_vendor.o(onIsWarehouseChange),
|
|
||||||
ao: common_vendor.o(($event) => isWarehouse.value = $event),
|
|
||||||
ap: common_vendor.p({
|
|
||||||
modelValue: isWarehouse.value
|
|
||||||
}),
|
|
||||||
aq: common_vendor.o(($event) => warehouseRule.val = $event),
|
|
||||||
ar: common_vendor.p({
|
|
||||||
type: "number",
|
|
||||||
placeholder: "0",
|
|
||||||
["input-align"]: "right",
|
|
||||||
modelValue: warehouseRule.val
|
|
||||||
}),
|
|
||||||
as: common_vendor.p({
|
|
||||||
label: 1
|
|
||||||
}),
|
|
||||||
at: common_vendor.p({
|
|
||||||
label: 2
|
|
||||||
}),
|
|
||||||
av: common_vendor.o(($event) => warehouseRule.val_type = $event),
|
|
||||||
aw: common_vendor.p({
|
|
||||||
direction: "horizontal",
|
|
||||||
modelValue: warehouseRule.val_type
|
|
||||||
}),
|
|
||||||
ax: common_vendor.o(($event) => saveWarehouseRule()),
|
|
||||||
ay: common_vendor.p({
|
|
||||||
type: "primary",
|
|
||||||
block: true
|
|
||||||
})
|
|
||||||
} : {});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-9320a8b3"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/config/price.js.map
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "价格调整",
|
|
||||||
"enablePullDownRefresh": false,
|
|
||||||
"usingComponents": {
|
|
||||||
"z-tabs": "../../uni_modules/z-tabs/components/z-tabs/z-tabs",
|
|
||||||
"nut-noticebar": "../../uni_modules/nutui-uni/components/noticebar/noticebar",
|
|
||||||
"nut-button": "../../uni_modules/nutui-uni/components/button/button",
|
|
||||||
"nut-input": "../../uni_modules/nutui-uni/components/input/input",
|
|
||||||
"nut-radio": "../../uni_modules/nutui-uni/components/radio/radio",
|
|
||||||
"nut-radio-group": "../../uni_modules/nutui-uni/components/radiogroup/radiogroup",
|
|
||||||
"nut-menu-item": "../../uni_modules/nutui-uni/components/menuitem/menuitem",
|
|
||||||
"nut-menu": "../../uni_modules/nutui-uni/components/menu/menu",
|
|
||||||
"nut-tag": "../../uni_modules/nutui-uni/components/tag/tag",
|
|
||||||
"z-paging": "../../uni_modules/z-paging/components/z-paging/z-paging",
|
|
||||||
"nut-popup": "../../uni_modules/nutui-uni/components/popup/popup",
|
|
||||||
"nut-switch": "../../uni_modules/nutui-uni/components/switch/switch",
|
|
||||||
"nut-cell": "../../uni_modules/nutui-uni/components/cell/cell"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because one or more lines are too long
373
unpackage/dist/dev/mp-weixin/pages/config/price.wxss
vendored
373
unpackage/dist/dev/mp-weixin/pages/config/price.wxss
vendored
@@ -1,373 +0,0 @@
|
|||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
.page-content.data-v-9320a8b3 {
|
|
||||||
height: 100vh;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
--nut-menu-bar-box-shadow: none;
|
|
||||||
--nut-menu-item-content-padding: 20rpx;
|
|
||||||
--nut-menu-item-content-max-height: 900rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Tabs 固定在顶部 */
|
|
||||||
.tabs-wrapper.data-v-9320a8b3 {
|
|
||||||
position: -webkit-sticky;
|
|
||||||
position: sticky;
|
|
||||||
top: 0;
|
|
||||||
z-index: 999;
|
|
||||||
background-color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 滚动区域撑满剩余高度 */
|
|
||||||
.scroll-area.data-v-9320a8b3 {
|
|
||||||
flex: 1;
|
|
||||||
background-color: #f2f3f5;
|
|
||||||
/* 灰色背景 */
|
|
||||||
}
|
|
||||||
.top-bar.data-v-9320a8b3 {
|
|
||||||
background: #fff;
|
|
||||||
padding: 20rpx;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
border-top: 1px solid #eee;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 规则样式 */
|
|
||||||
.rule-item.data-v-9320a8b3 {
|
|
||||||
background: #fff;
|
|
||||||
padding: 20rpx;
|
|
||||||
margin: 20rpx;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
}
|
|
||||||
.row.data-v-9320a8b3 {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
margin-bottom: 10rpx;
|
|
||||||
}
|
|
||||||
.field.data-v-9320a8b3 {
|
|
||||||
width: 48%;
|
|
||||||
}
|
|
||||||
.label.data-v-9320a8b3 {
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #333;
|
|
||||||
margin-bottom: 6rpx;
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
.delete-btn.data-v-9320a8b3 {
|
|
||||||
text-align: right;
|
|
||||||
margin-top: 10rpx;
|
|
||||||
}
|
|
||||||
.data-v-9320a8b3 .titleClass .nut-menu__title-text {
|
|
||||||
font-size: 30rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
color: black;
|
|
||||||
}
|
|
||||||
.filter-types.data-v-9320a8b3 {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-start;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
overflow: auto;
|
|
||||||
gap: 10rpx;
|
|
||||||
padding: 10rpx;
|
|
||||||
height: 60rpx;
|
|
||||||
background-color: #fff;
|
|
||||||
border-bottom: 2rpx solid gainsboro;
|
|
||||||
border-top: 2rpx solid gainsboro;
|
|
||||||
}
|
|
||||||
.filter-types .filter-type-inner.data-v-9320a8b3 {
|
|
||||||
align-items: center;
|
|
||||||
background-color: rgba(0, 0, 0, 0.05);
|
|
||||||
border-radius: 16rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
display: flex;
|
|
||||||
flex: 0 0 auto;
|
|
||||||
font-size: 28rpx;
|
|
||||||
gap: 15rpx;
|
|
||||||
padding: 10rpx 20rpx;
|
|
||||||
}
|
|
||||||
.filter-types .filter-type-inner.active.data-v-9320a8b3 {
|
|
||||||
background-color: rgba(250, 44, 25, 0.1);
|
|
||||||
color: var(--nutui-color-primary);
|
|
||||||
}
|
|
||||||
.tabs-container.data-v-9320a8b3 {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
.tabs-container .tab-pane-inner.data-v-9320a8b3 {
|
|
||||||
height: 600rpx;
|
|
||||||
}
|
|
||||||
.tabs-container .tabs-inner.data-v-9320a8b3 {
|
|
||||||
overflow-y: scroll;
|
|
||||||
height: 600rpx;
|
|
||||||
width: 160rpx;
|
|
||||||
background-color: #F5F5F5;
|
|
||||||
}
|
|
||||||
.tabs-container .tabs-inner .tab-inner.data-v-9320a8b3 {
|
|
||||||
display: flex;
|
|
||||||
height: 60rpx;
|
|
||||||
padding: 10rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
background: #F5F5F5;
|
|
||||||
}
|
|
||||||
.tabs-container .tabs-inner .tab-inner text.data-v-9320a8b3 {
|
|
||||||
width: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.tabs-container .tabs-inner .tab-inner-active.data-v-9320a8b3 {
|
|
||||||
background-color: rgba(250, 44, 25, 0.1);
|
|
||||||
color: var(--nutui-color-primary);
|
|
||||||
}
|
|
||||||
.degree-inner.data-v-9320a8b3 {
|
|
||||||
display: flex;
|
|
||||||
flex: 1;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 10rpx;
|
|
||||||
width: 100%;
|
|
||||||
margin-bottom: 60rpx;
|
|
||||||
}
|
|
||||||
.degree-item.data-v-9320a8b3 {
|
|
||||||
align-items: center;
|
|
||||||
background-color: rgba(0, 0, 0, 0.05);
|
|
||||||
border-radius: 10rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
display: flex;
|
|
||||||
flex: 0 0 auto;
|
|
||||||
font-size: 26rpx;
|
|
||||||
gap: 10rpx;
|
|
||||||
justify-content: center;
|
|
||||||
min-height: 80rpx;
|
|
||||||
width: calc(50% - 10rpx);
|
|
||||||
}
|
|
||||||
.degree-item.active.data-v-9320a8b3 {
|
|
||||||
background-color: rgba(250, 44, 25, 0.1);
|
|
||||||
color: var(--nutui-color-primary);
|
|
||||||
}
|
|
||||||
.product-btns.data-v-9320a8b3 {
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
padding: 20rpx 0;
|
|
||||||
}
|
|
||||||
.product-btns .reset.data-v-9320a8b3 {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
.product-btns .confirm.data-v-9320a8b3 {
|
|
||||||
flex: 2;
|
|
||||||
}
|
|
||||||
.degree-btns.data-v-9320a8b3 {
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.degree-btns .reset.data-v-9320a8b3 {
|
|
||||||
flex: 1;
|
|
||||||
/* 重置按钮占 1 份 */
|
|
||||||
}
|
|
||||||
.degree-btns .confirm.data-v-9320a8b3 {
|
|
||||||
flex: 2;
|
|
||||||
/* 确认按钮占 2 份 */
|
|
||||||
}
|
|
||||||
.goods-item.data-v-9320a8b3 {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
padding: 20rpx;
|
|
||||||
background-color: #ffffff;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
gap: 20rpx;
|
|
||||||
}
|
|
||||||
.goods-item .goods-item-image.data-v-9320a8b3 {
|
|
||||||
width: 170rpx;
|
|
||||||
height: 170rpx;
|
|
||||||
}
|
|
||||||
.goods-item .goods-item-image .goods-item-image-img.data-v-9320a8b3 {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
.goods-item .goods-item-content.data-v-9320a8b3 {
|
|
||||||
display: flex;
|
|
||||||
flex: 1;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: space-between;
|
|
||||||
/* 首尾贴边,中间均分 */
|
|
||||||
}
|
|
||||||
.goods-item .goods-item-content .goods-item-content-header.data-v-9320a8b3 {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
padding: 10rpx 0;
|
|
||||||
gap: 20rpx;
|
|
||||||
}
|
|
||||||
.goods-item .goods-item-content .goods-item-content-body.data-v-9320a8b3 {
|
|
||||||
padding: 10rpx 0;
|
|
||||||
}
|
|
||||||
.goods-item .goods-item-content .goods-item-content-body .goods-item-content-body-desc.data-v-9320a8b3 {
|
|
||||||
color: #7c7c7c;
|
|
||||||
font-size: 26rpx;
|
|
||||||
}
|
|
||||||
.goods-item .goods-item-content .goods-item-content-footer.data-v-9320a8b3 {
|
|
||||||
padding: 10rpx 0;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.goods-item .goods-item-content .goods-item-content-footer .goods-item-content-footer-btn.data-v-9320a8b3 {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
gap: 10rpx;
|
|
||||||
}
|
|
||||||
.goods-item .goods-item-content .goods-item-content-footer .goods-item-content-footer-btn .share-btn.data-v-9320a8b3 {
|
|
||||||
border-radius: 50rpx;
|
|
||||||
border: 2rpx solid red;
|
|
||||||
font-size: 26rpx;
|
|
||||||
align-items: center;
|
|
||||||
height: 54rpx;
|
|
||||||
color: red;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 商品弹出改价 **/
|
|
||||||
.goods-popup .goods-card-edit.data-v-9320a8b3 {
|
|
||||||
background: #fff;
|
|
||||||
padding: 20rpx;
|
|
||||||
margin: 20rpx;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
}
|
|
||||||
.goods-popup .goods-card-edit .row.data-v-9320a8b3 {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
margin-bottom: 10rpx;
|
|
||||||
}
|
|
||||||
.goods-popup .goods-card-edit .field.data-v-9320a8b3 {
|
|
||||||
width: 48%;
|
|
||||||
}
|
|
||||||
.goods-popup .goods-card-edit .label.data-v-9320a8b3 {
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #333;
|
|
||||||
margin-bottom: 6rpx;
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
.goods-popup .goods-card.data-v-9320a8b3 {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
padding: 20rpx;
|
|
||||||
background-color: #ffffff;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
}
|
|
||||||
.goods-popup .goods-card .goods-card-left.data-v-9320a8b3 {
|
|
||||||
width: 190rpx;
|
|
||||||
height: 190rpx;
|
|
||||||
}
|
|
||||||
.goods-popup .goods-card .goods-card-left image.data-v-9320a8b3 {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
.goods-popup .goods-card .goods-card-right.data-v-9320a8b3 {
|
|
||||||
flex: 1;
|
|
||||||
padding-left: 20rpx;
|
|
||||||
}
|
|
||||||
.goods-popup .goods-card .goods-card-right .goods-card-right-top.data-v-9320a8b3 {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
padding: 10rpx 0;
|
|
||||||
gap: 20rpx;
|
|
||||||
}
|
|
||||||
.goods-popup .goods-card .goods-card-right .goods-card-right-middle.data-v-9320a8b3 {
|
|
||||||
margin-top: 10rpx;
|
|
||||||
margin-bottom: 10rpx;
|
|
||||||
color: #7c7c7c;
|
|
||||||
font-size: 26rpx;
|
|
||||||
}
|
|
||||||
.goods-popup .goods-card .goods-card-right .goods-card-right-bottom.data-v-9320a8b3 {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
/******/
|
|
||||||
.switch-lab.data-v-9320a8b3 {
|
|
||||||
padding: 0 10px;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: 400;
|
|
||||||
color: #909ca4;
|
|
||||||
}
|
|
||||||
.warehouse .warehouse-edit.data-v-9320a8b3 {
|
|
||||||
background: #fff;
|
|
||||||
padding: 20rpx;
|
|
||||||
margin: 20rpx;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
}
|
|
||||||
.warehouse .warehouse-edit .row.data-v-9320a8b3 {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
margin-bottom: 10rpx;
|
|
||||||
}
|
|
||||||
.warehouse .warehouse-edit .field.data-v-9320a8b3 {
|
|
||||||
width: 48%;
|
|
||||||
}
|
|
||||||
.warehouse .warehouse-edit .label.data-v-9320a8b3 {
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #333;
|
|
||||||
margin-bottom: 6rpx;
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
@@ -1,128 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../../common/vendor.js");
|
|
||||||
const api_order = require("../../../api/order.js");
|
|
||||||
const utils_helper = require("../../../utils/helper.js");
|
|
||||||
const api_config = require("../../../api/config.js");
|
|
||||||
if (!Array) {
|
|
||||||
const _easycom_nut_step2 = common_vendor.resolveComponent("nut-step");
|
|
||||||
const _easycom_nut_steps2 = common_vendor.resolveComponent("nut-steps");
|
|
||||||
const _easycom_nut_cell2 = common_vendor.resolveComponent("nut-cell");
|
|
||||||
const _easycom_nut_cell_group2 = common_vendor.resolveComponent("nut-cell-group");
|
|
||||||
const _easycom_nut_tag2 = common_vendor.resolveComponent("nut-tag");
|
|
||||||
const _easycom_nut_price2 = common_vendor.resolveComponent("nut-price");
|
|
||||||
(_easycom_nut_step2 + _easycom_nut_steps2 + _easycom_nut_cell2 + _easycom_nut_cell_group2 + _easycom_nut_tag2 + _easycom_nut_price2)();
|
|
||||||
}
|
|
||||||
const _easycom_nut_step = () => "../../../uni_modules/nutui-uni/components/step/step.js";
|
|
||||||
const _easycom_nut_steps = () => "../../../uni_modules/nutui-uni/components/steps/steps.js";
|
|
||||||
const _easycom_nut_cell = () => "../../../uni_modules/nutui-uni/components/cell/cell.js";
|
|
||||||
const _easycom_nut_cell_group = () => "../../../uni_modules/nutui-uni/components/cellgroup/cellgroup.js";
|
|
||||||
const _easycom_nut_tag = () => "../../../uni_modules/nutui-uni/components/tag/tag.js";
|
|
||||||
const _easycom_nut_price = () => "../../../uni_modules/nutui-uni/components/price/price.js";
|
|
||||||
if (!Math) {
|
|
||||||
(_easycom_nut_step + _easycom_nut_steps + _easycom_nut_cell + _easycom_nut_cell_group + _easycom_nut_tag + _easycom_nut_price)();
|
|
||||||
}
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "detail",
|
|
||||||
setup(__props) {
|
|
||||||
const audit = common_vendor.ref(true);
|
|
||||||
const id = common_vendor.ref(0);
|
|
||||||
const detail = common_vendor.reactive({});
|
|
||||||
const images = common_vendor.ref([]);
|
|
||||||
common_vendor.onLoad((options) => {
|
|
||||||
id.value = options.id;
|
|
||||||
});
|
|
||||||
common_vendor.onShow(() => {
|
|
||||||
getConfig();
|
|
||||||
api_order.fetchOrderDetail(id.value).then((res) => {
|
|
||||||
Object.assign(detail, res);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
const getConfig = () => {
|
|
||||||
api_config.fetchGetConfig().then((res) => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/shopOrder/detail.vue:126", "getConfig=====>", res);
|
|
||||||
audit.value = res.appConfig.is_audit == 1;
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/shopOrder/detail.vue:128", res.appConfig.pay_imgs);
|
|
||||||
let pay_imgs = JSON.parse(res.appConfig.pay_imgs) || [];
|
|
||||||
let wechat_imgs = JSON.parse(res.appConfig.wechat_imgs) || [];
|
|
||||||
let pay_imgs_arr = pay_imgs.map((item) => item.file_path) || [];
|
|
||||||
let wechat_imgs_arr = wechat_imgs.map((item) => item.file_path) || [];
|
|
||||||
const merged_imgs_arr = pay_imgs_arr.concat(wechat_imgs_arr);
|
|
||||||
images.value = merged_imgs_arr;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: common_vendor.p({
|
|
||||||
title: "待付款"
|
|
||||||
}),
|
|
||||||
b: common_vendor.p({
|
|
||||||
title: "待发货"
|
|
||||||
}),
|
|
||||||
c: common_vendor.p({
|
|
||||||
title: "待收货"
|
|
||||||
}),
|
|
||||||
d: common_vendor.p({
|
|
||||||
title: "已完成"
|
|
||||||
}),
|
|
||||||
e: common_vendor.p({
|
|
||||||
current: detail.progress
|
|
||||||
}),
|
|
||||||
f: detail.address_info
|
|
||||||
}, detail.address_info ? {
|
|
||||||
g: common_vendor.t(detail.address_info.user_name),
|
|
||||||
h: common_vendor.t(detail.address_info.tel_number),
|
|
||||||
i: common_vendor.t(detail.address_info.province_name + detail.address_info.city_name + detail.address_info.county_name + detail.address_info.street_name + detail.address_info.detail_info_new)
|
|
||||||
} : {}, {
|
|
||||||
j: common_vendor.f(detail.goods, (goods, index, i0) => {
|
|
||||||
return {
|
|
||||||
a: common_vendor.t(goods.snapshot_info.degree.degree_name),
|
|
||||||
b: "4bf0d63e-9-" + i0 + "," + ("4bf0d63e-8-" + i0),
|
|
||||||
c: common_vendor.t(goods.goods_name),
|
|
||||||
d: common_vendor.t(goods.goods_no),
|
|
||||||
e: "4bf0d63e-10-" + i0 + "," + ("4bf0d63e-8-" + i0),
|
|
||||||
f: common_vendor.p({
|
|
||||||
price: goods.goods_price,
|
|
||||||
size: "small",
|
|
||||||
["need-symbol"]: true
|
|
||||||
}),
|
|
||||||
g: index,
|
|
||||||
h: common_vendor.o(($event) => common_vendor.unref(utils_helper.navigateTo)("/pages/mall/detail?id=" + goods.goods_id), index),
|
|
||||||
i: "4bf0d63e-8-" + i0 + ",4bf0d63e-7"
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
k: common_vendor.p({
|
|
||||||
["custom-color"]: "#1a1a1a"
|
|
||||||
}),
|
|
||||||
l: common_vendor.p({
|
|
||||||
center: true
|
|
||||||
}),
|
|
||||||
m: common_vendor.p({
|
|
||||||
price: detail.pay_price,
|
|
||||||
size: "normal",
|
|
||||||
["need-symbol"]: true
|
|
||||||
}),
|
|
||||||
n: common_vendor.p({
|
|
||||||
title: "订单编号",
|
|
||||||
desc: detail.order_no
|
|
||||||
}),
|
|
||||||
o: common_vendor.p({
|
|
||||||
title: "下单时间",
|
|
||||||
desc: detail.create_time
|
|
||||||
}),
|
|
||||||
p: detail.progress >= 3
|
|
||||||
}, detail.progress >= 3 ? {
|
|
||||||
q: common_vendor.p({
|
|
||||||
title: "物流公司",
|
|
||||||
desc: detail.express_company
|
|
||||||
}),
|
|
||||||
r: common_vendor.p({
|
|
||||||
title: "物流单号",
|
|
||||||
desc: detail.express_no
|
|
||||||
})
|
|
||||||
} : {});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-4bf0d63e"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/pages/config/shopOrder/detail.js.map
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "店铺订单-详情",
|
|
||||||
"usingComponents": {
|
|
||||||
"nut-step": "../../../uni_modules/nutui-uni/components/step/step",
|
|
||||||
"nut-steps": "../../../uni_modules/nutui-uni/components/steps/steps",
|
|
||||||
"nut-cell": "../../../uni_modules/nutui-uni/components/cell/cell",
|
|
||||||
"nut-cell-group": "../../../uni_modules/nutui-uni/components/cellgroup/cellgroup",
|
|
||||||
"nut-tag": "../../../uni_modules/nutui-uni/components/tag/tag",
|
|
||||||
"nut-price": "../../../uni_modules/nutui-uni/components/price/price"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<view class="page-content data-v-4bf0d63e"><nut-steps wx:if="{{e}}" class="data-v-4bf0d63e" u-s="{{['d']}}" u-i="4bf0d63e-0" bind:__l="__l" u-p="{{e}}"><nut-step wx:if="{{a}}" class="data-v-4bf0d63e" u-s="{{['d']}}" u-i="4bf0d63e-1,4bf0d63e-0" bind:__l="__l" u-p="{{a}}">1</nut-step><nut-step wx:if="{{b}}" class="data-v-4bf0d63e" u-s="{{['d']}}" u-i="4bf0d63e-2,4bf0d63e-0" bind:__l="__l" u-p="{{b}}">2</nut-step><nut-step wx:if="{{c}}" class="data-v-4bf0d63e" u-s="{{['d']}}" u-i="4bf0d63e-3,4bf0d63e-0" bind:__l="__l" u-p="{{c}}">3</nut-step><nut-step wx:if="{{d}}" class="data-v-4bf0d63e" u-s="{{['d']}}" u-i="4bf0d63e-4,4bf0d63e-0" bind:__l="__l" u-p="{{d}}">4</nut-step></nut-steps><nut-cell-group class="data-v-4bf0d63e" u-s="{{['d']}}" u-i="4bf0d63e-5" bind:__l="__l"><nut-cell class="data-v-4bf0d63e" u-s="{{['d']}}" u-i="4bf0d63e-6,4bf0d63e-5" bind:__l="__l"><view wx:if="{{f}}" class="address-inner data-v-4bf0d63e"><text class="data-v-4bf0d63e">{{g}} - {{h}}</text><text class="data-v-4bf0d63e">{{i}}</text></view></nut-cell></nut-cell-group><nut-cell-group class="data-v-4bf0d63e" u-s="{{['d']}}" u-i="4bf0d63e-7" bind:__l="__l"><nut-cell wx:for="{{j}}" wx:for-item="goods" wx:key="g" class="data-v-4bf0d63e" u-s="{{['title','link']}}" bindclick="{{goods.h}}" u-i="{{goods.i}}" bind:__l="__l" u-p="{{l}}"><view class="goods-info-row data-v-4bf0d63e" slot="title"><view class="left-text data-v-4bf0d63e"><view class="goods-name data-v-4bf0d63e"><nut-tag wx:if="{{k}}" class="data-v-4bf0d63e" u-s="{{['d']}}" u-i="{{goods.b}}" bind:__l="__l" u-p="{{k}}">{{goods.a}}</nut-tag><text class="data-v-4bf0d63e" style="margin-left:10rpx">{{goods.c}}</text></view><text class="goods-no data-v-4bf0d63e">串号:{{goods.d}}</text></view></view><nut-price class="data-v-4bf0d63e" u-i="{{goods.e}}" bind:__l="__l" u-p="{{goods.f}}" slot="link"/></nut-cell></nut-cell-group><nut-cell-group class="data-v-4bf0d63e" u-s="{{['d']}}" u-i="4bf0d63e-11" bind:__l="__l"><nut-cell class="data-v-4bf0d63e" u-s="{{['d']}}" u-i="4bf0d63e-12,4bf0d63e-11" bind:__l="__l"><view class="total-price-inner data-v-4bf0d63e"><text class="data-v-4bf0d63e">商品总额</text><nut-price wx:if="{{m}}" class="data-v-4bf0d63e" u-i="4bf0d63e-13,4bf0d63e-12" bind:__l="__l" u-p="{{m}}"/></view></nut-cell></nut-cell-group><nut-cell-group class="data-v-4bf0d63e" u-s="{{['d']}}" u-i="4bf0d63e-14" bind:__l="__l"><nut-cell wx:if="{{n}}" class="data-v-4bf0d63e" u-i="4bf0d63e-15,4bf0d63e-14" bind:__l="__l" u-p="{{n}}"/><nut-cell wx:if="{{o}}" class="data-v-4bf0d63e" u-i="4bf0d63e-16,4bf0d63e-14" bind:__l="__l" u-p="{{o}}"/></nut-cell-group><nut-cell-group wx:if="{{p}}" class="data-v-4bf0d63e" u-s="{{['d']}}" u-i="4bf0d63e-17" bind:__l="__l"><nut-cell wx:if="{{q}}" class="data-v-4bf0d63e" u-i="4bf0d63e-18,4bf0d63e-17" bind:__l="__l" u-p="{{q}}"/><nut-cell wx:if="{{r}}" class="data-v-4bf0d63e" u-i="4bf0d63e-19,4bf0d63e-17" bind:__l="__l" u-p="{{r}}"/></nut-cell-group></view>
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
.page-content.data-v-4bf0d63e {
|
|
||||||
min-height: 100vh;
|
|
||||||
background-color: #f2f3f5;
|
|
||||||
padding: 20rpx;
|
|
||||||
}
|
|
||||||
.address-inner.data-v-4bf0d63e {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
.total-price-inner.data-v-4bf0d63e {
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.total-price-inner view.data-v-4bf0d63e:nth-child(2) {
|
|
||||||
color: #fa2c19;
|
|
||||||
}
|
|
||||||
.wechat-img-inner.data-v-4bf0d63e {
|
|
||||||
margin-top: 60rpx;
|
|
||||||
padding: 0rpx 80rpx;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
@@ -1,407 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../../common/vendor.js");
|
|
||||||
const api_order = require("../../../api/order.js");
|
|
||||||
const api_config = require("../../../api/config.js");
|
|
||||||
if (!Array) {
|
|
||||||
const _easycom_nut_dialog2 = common_vendor.resolveComponent("nut-dialog");
|
|
||||||
const _easycom_nut_button2 = common_vendor.resolveComponent("nut-button");
|
|
||||||
const _easycom_nut_searchbar2 = common_vendor.resolveComponent("nut-searchbar");
|
|
||||||
const _easycom_nut_tabs2 = common_vendor.resolveComponent("nut-tabs");
|
|
||||||
const _easycom_nut_sticky2 = common_vendor.resolveComponent("nut-sticky");
|
|
||||||
const _easycom_nut_tag2 = common_vendor.resolveComponent("nut-tag");
|
|
||||||
const _easycom_nut_price2 = common_vendor.resolveComponent("nut-price");
|
|
||||||
const _easycom_z_paging2 = common_vendor.resolveComponent("z-paging");
|
|
||||||
const _easycom_nut_cell2 = common_vendor.resolveComponent("nut-cell");
|
|
||||||
const _easycom_nut_cell_group2 = common_vendor.resolveComponent("nut-cell-group");
|
|
||||||
const _easycom_nut_input2 = common_vendor.resolveComponent("nut-input");
|
|
||||||
const _easycom_nut_form_item2 = common_vendor.resolveComponent("nut-form-item");
|
|
||||||
const _easycom_nut_form2 = common_vendor.resolveComponent("nut-form");
|
|
||||||
const _easycom_nut_popup2 = common_vendor.resolveComponent("nut-popup");
|
|
||||||
(_easycom_nut_dialog2 + _easycom_nut_button2 + _easycom_nut_searchbar2 + _easycom_nut_tabs2 + _easycom_nut_sticky2 + _easycom_nut_tag2 + _easycom_nut_price2 + _easycom_z_paging2 + _easycom_nut_cell2 + _easycom_nut_cell_group2 + _easycom_nut_input2 + _easycom_nut_form_item2 + _easycom_nut_form2 + _easycom_nut_popup2)();
|
|
||||||
}
|
|
||||||
const _easycom_nut_dialog = () => "../../../uni_modules/nutui-uni/components/dialog/dialog.js";
|
|
||||||
const _easycom_nut_button = () => "../../../uni_modules/nutui-uni/components/button/button.js";
|
|
||||||
const _easycom_nut_searchbar = () => "../../../uni_modules/nutui-uni/components/searchbar/searchbar.js";
|
|
||||||
const _easycom_nut_tabs = () => "../../../uni_modules/nutui-uni/components/tabs/tabs.js";
|
|
||||||
const _easycom_nut_sticky = () => "../../../uni_modules/nutui-uni/components/sticky/sticky.js";
|
|
||||||
const _easycom_nut_tag = () => "../../../uni_modules/nutui-uni/components/tag/tag.js";
|
|
||||||
const _easycom_nut_price = () => "../../../uni_modules/nutui-uni/components/price/price.js";
|
|
||||||
const _easycom_z_paging = () => "../../../uni_modules/z-paging/components/z-paging/z-paging.js";
|
|
||||||
const _easycom_nut_cell = () => "../../../uni_modules/nutui-uni/components/cell/cell.js";
|
|
||||||
const _easycom_nut_cell_group = () => "../../../uni_modules/nutui-uni/components/cellgroup/cellgroup.js";
|
|
||||||
const _easycom_nut_input = () => "../../../uni_modules/nutui-uni/components/input/input.js";
|
|
||||||
const _easycom_nut_form_item = () => "../../../uni_modules/nutui-uni/components/formitem/formitem.js";
|
|
||||||
const _easycom_nut_form = () => "../../../uni_modules/nutui-uni/components/form/form.js";
|
|
||||||
const _easycom_nut_popup = () => "../../../uni_modules/nutui-uni/components/popup/popup.js";
|
|
||||||
if (!Math) {
|
|
||||||
(_easycom_nut_dialog + _easycom_nut_button + _easycom_nut_searchbar + _easycom_nut_tabs + _easycom_nut_sticky + _easycom_nut_tag + _easycom_nut_price + _easycom_z_paging + _easycom_nut_cell + _easycom_nut_cell_group + _easycom_nut_input + _easycom_nut_form_item + _easycom_nut_form + _easycom_nut_popup)();
|
|
||||||
}
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "index",
|
|
||||||
setup(__props) {
|
|
||||||
const audit = common_vendor.ref(true);
|
|
||||||
const images = common_vendor.ref([]);
|
|
||||||
const openDeliveryPopup = common_vendor.ref(false);
|
|
||||||
const orderDetail = common_vendor.reactive({});
|
|
||||||
const form = common_vendor.reactive({
|
|
||||||
order_id: 0,
|
|
||||||
express_company: "",
|
|
||||||
express_no: ""
|
|
||||||
});
|
|
||||||
const deliveryOrder = () => {
|
|
||||||
form.order_id = orderDetail.order_id;
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/shopOrder/index.vue:233", "form===>", form);
|
|
||||||
api_order.fetchDeliveryOrder(form).then((res) => {
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
icon: "none",
|
|
||||||
title: "发货成功"
|
|
||||||
});
|
|
||||||
onCloseDeliveryPopup();
|
|
||||||
paging.value.reload();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const onClickDeliveryOrder = (order) => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/shopOrder/index.vue:246", order);
|
|
||||||
Object.assign(orderDetail, order);
|
|
||||||
openDeliveryPopup.value = true;
|
|
||||||
};
|
|
||||||
const onCloseDeliveryPopup = () => {
|
|
||||||
Object.assign(orderDetail, {});
|
|
||||||
Object.assign(form, {
|
|
||||||
order_id: 0,
|
|
||||||
express_company: "",
|
|
||||||
express_no: ""
|
|
||||||
});
|
|
||||||
openDeliveryPopup.value = false;
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/shopOrder/index.vue:262", "关闭");
|
|
||||||
};
|
|
||||||
const current_tab_idx = common_vendor.ref(0);
|
|
||||||
const dataList = common_vendor.ref([]);
|
|
||||||
const paging = common_vendor.ref(null);
|
|
||||||
const tabs_config = [
|
|
||||||
{
|
|
||||||
title: "全部",
|
|
||||||
status: "all"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "待付款",
|
|
||||||
status: "payment"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "待发货",
|
|
||||||
status: "delivery"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "待收货",
|
|
||||||
status: "received"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "已完成",
|
|
||||||
status: "finish"
|
|
||||||
}
|
|
||||||
];
|
|
||||||
const visibleCancelOrderDialog = common_vendor.ref(false);
|
|
||||||
const current_cancel_order_id = common_vendor.ref(0);
|
|
||||||
const visiblePayOrderDialog = common_vendor.ref(false);
|
|
||||||
const current_pay_order_id = common_vendor.ref(0);
|
|
||||||
const search_val = common_vendor.ref("");
|
|
||||||
const onChangeTab = (item, idx) => {
|
|
||||||
current_tab_idx.value = idx;
|
|
||||||
paging.value.reload();
|
|
||||||
};
|
|
||||||
const getConfig = () => {
|
|
||||||
api_config.fetchGetConfig().then((res) => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/shopOrder/index.vue:326", "getConfig=====>", res);
|
|
||||||
audit.value = res.appConfig.is_audit == 1;
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/shopOrder/index.vue:328", res.appConfig.pay_imgs);
|
|
||||||
let pay_imgs = JSON.parse(res.appConfig.pay_imgs) || [];
|
|
||||||
let wechat_imgs = JSON.parse(res.appConfig.wechat_imgs) || [];
|
|
||||||
let pay_imgs_arr = pay_imgs.map((item) => item.file_path) || [];
|
|
||||||
let wechat_imgs_arr = wechat_imgs.map((item) => item.file_path) || [];
|
|
||||||
const merged_imgs_arr = pay_imgs_arr.concat(wechat_imgs_arr);
|
|
||||||
images.value = merged_imgs_arr;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const navigateToDetail = (id) => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/shopOrder/index.vue:355", id);
|
|
||||||
if (!id) {
|
|
||||||
common_vendor.index.__f__("warn", "at pages/config/shopOrder/index.vue:357", "导航ID不能为空");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
common_vendor.index.navigateTo({
|
|
||||||
url: `/pages/config/shopOrder/detail?id=${encodeURIComponent(id)}`
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const onClickCancelOrder = () => {
|
|
||||||
api_order.fetchCancelOrder(current_cancel_order_id.value).then((res) => {
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
title: "取消成功",
|
|
||||||
icon: "none"
|
|
||||||
});
|
|
||||||
paging.value.reload();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const onClickPayOrder = () => {
|
|
||||||
api_order.fetchPayOrder(current_pay_order_id.value).then((res) => {
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
title: "标记付款成功",
|
|
||||||
icon: "none"
|
|
||||||
});
|
|
||||||
paging.value.reload();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const apiFetchOrderList = (pageNo = 1, pageSize = 10) => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/shopOrder/index.vue:395", tabs_config[current_tab_idx.value]["status"]);
|
|
||||||
const params = {
|
|
||||||
page: pageNo,
|
|
||||||
pageSize: 10,
|
|
||||||
status: tabs_config[current_tab_idx.value]["status"],
|
|
||||||
goods_no: search_val.value
|
|
||||||
};
|
|
||||||
api_order.fetchOrderList(params).then((res) => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/shopOrder/index.vue:403", res);
|
|
||||||
paging.value.complete(res.list);
|
|
||||||
}).catch((res) => {
|
|
||||||
paging.value.complete(false);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
common_vendor.onLoad((options) => {
|
|
||||||
current_tab_idx.value = parseInt(options.tab);
|
|
||||||
});
|
|
||||||
common_vendor.onShow(() => {
|
|
||||||
getConfig();
|
|
||||||
if (paging.value) {
|
|
||||||
paging.value.refresh();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
const onSearch = () => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/shopOrder/index.vue:433", "搜索:", search_val.value);
|
|
||||||
paging.value.reload();
|
|
||||||
};
|
|
||||||
const onClear = () => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/shopOrder/index.vue:439", "搜索:", search_val.value);
|
|
||||||
paging.value.reload();
|
|
||||||
};
|
|
||||||
const getStatusText = (order) => {
|
|
||||||
if (order.order_status.value == 20) {
|
|
||||||
return order.order_status.text;
|
|
||||||
} else if (order.order_status.value == 30) {
|
|
||||||
return order.order_status.text;
|
|
||||||
} else if (order.order_status.value == 10) {
|
|
||||||
if (order.pay_status.value == 10) {
|
|
||||||
return order.pay_status.text;
|
|
||||||
} else if (order.pay_status.value == 20) {
|
|
||||||
if (order.delivery_status.value == 10) {
|
|
||||||
return order.delivery_status.text;
|
|
||||||
} else if (order.delivery_status.value == 20) {
|
|
||||||
return order.receipt_status.text;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: common_vendor.o(($event) => visibleCancelOrderDialog.value = false),
|
|
||||||
b: common_vendor.o(onClickCancelOrder),
|
|
||||||
c: common_vendor.o(($event) => visibleCancelOrderDialog.value = $event),
|
|
||||||
d: common_vendor.p({
|
|
||||||
title: "取消订单",
|
|
||||||
content: "确认取消吗?此操作不可恢复!",
|
|
||||||
visible: visibleCancelOrderDialog.value
|
|
||||||
}),
|
|
||||||
e: common_vendor.o(($event) => visiblePayOrderDialog.value = false),
|
|
||||||
f: common_vendor.o(onClickPayOrder),
|
|
||||||
g: common_vendor.o(($event) => visiblePayOrderDialog.value = $event),
|
|
||||||
h: common_vendor.p({
|
|
||||||
title: "标记付款",
|
|
||||||
content: "确认标记吗?此操作不可恢复!",
|
|
||||||
visible: visiblePayOrderDialog.value
|
|
||||||
}),
|
|
||||||
i: common_vendor.o(onSearch),
|
|
||||||
j: common_vendor.p({
|
|
||||||
size: "small",
|
|
||||||
type: "primary"
|
|
||||||
}),
|
|
||||||
k: common_vendor.o(onSearch),
|
|
||||||
l: common_vendor.o(onClear),
|
|
||||||
m: common_vendor.o(($event) => search_val.value = $event),
|
|
||||||
n: common_vendor.p({
|
|
||||||
placeholder: "请输入商品串号",
|
|
||||||
clearable: true,
|
|
||||||
["input-background"]: "#eee",
|
|
||||||
modelValue: search_val.value
|
|
||||||
}),
|
|
||||||
o: common_vendor.f(tabs_config, (item, idx, i0) => {
|
|
||||||
return {
|
|
||||||
a: common_vendor.t(item.title),
|
|
||||||
b: idx,
|
|
||||||
c: idx === current_tab_idx.value ? 1 : "",
|
|
||||||
d: common_vendor.o(($event) => onChangeTab(item, idx), idx)
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
p: common_vendor.o(($event) => current_tab_idx.value = $event),
|
|
||||||
q: common_vendor.p({
|
|
||||||
background: "#fff",
|
|
||||||
modelValue: current_tab_idx.value
|
|
||||||
}),
|
|
||||||
r: common_vendor.f(dataList.value, (order, index, i0) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: common_vendor.t(order.create_time),
|
|
||||||
b: common_vendor.t(getStatusText(order)),
|
|
||||||
c: "c1fe0406-7-" + i0 + ",c1fe0406-6",
|
|
||||||
d: common_vendor.f(order.goods, (goods, iidx, i1) => {
|
|
||||||
return {
|
|
||||||
a: common_vendor.t(goods.snapshot_info.degree.degree_name),
|
|
||||||
b: "c1fe0406-8-" + i0 + "-" + i1 + ",c1fe0406-6",
|
|
||||||
c: common_vendor.t(goods.goods_name),
|
|
||||||
d: common_vendor.t(goods.goods_no),
|
|
||||||
e: "c1fe0406-9-" + i0 + "-" + i1 + ",c1fe0406-6",
|
|
||||||
f: common_vendor.p({
|
|
||||||
price: goods.goods_price,
|
|
||||||
size: "small",
|
|
||||||
["need-symbol"]: true
|
|
||||||
}),
|
|
||||||
g: iidx,
|
|
||||||
h: common_vendor.o(($event) => navigateToDetail(order.order_id), iidx)
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
e: "c1fe0406-10-" + i0 + ",c1fe0406-6",
|
|
||||||
f: common_vendor.p({
|
|
||||||
price: order.total_price,
|
|
||||||
size: "normal",
|
|
||||||
["need-symbol"]: true
|
|
||||||
}),
|
|
||||||
g: order.order_status.value === 10
|
|
||||||
}, order.order_status.value === 10 ? common_vendor.e({
|
|
||||||
h: order.delivery_status.value !== 20
|
|
||||||
}, order.delivery_status.value !== 20 ? {
|
|
||||||
i: common_vendor.o(($event) => {
|
|
||||||
visibleCancelOrderDialog.value = true;
|
|
||||||
current_cancel_order_id.value = order.order_id;
|
|
||||||
}, index),
|
|
||||||
j: "c1fe0406-11-" + i0 + ",c1fe0406-6",
|
|
||||||
k: common_vendor.p({
|
|
||||||
plain: true,
|
|
||||||
size: "small"
|
|
||||||
})
|
|
||||||
} : {}, {
|
|
||||||
l: order.pay_status.value === 10 && !audit.value
|
|
||||||
}, order.pay_status.value === 10 && !audit.value ? {
|
|
||||||
m: common_vendor.o(($event) => {
|
|
||||||
visiblePayOrderDialog.value = true;
|
|
||||||
current_pay_order_id.value = order.order_id;
|
|
||||||
}, index),
|
|
||||||
n: "c1fe0406-12-" + i0 + ",c1fe0406-6",
|
|
||||||
o: common_vendor.p({
|
|
||||||
type: "primary",
|
|
||||||
size: "small"
|
|
||||||
})
|
|
||||||
} : {}, {
|
|
||||||
p: order.pay_status.value === 20 && order.delivery_status.value === 10
|
|
||||||
}, order.pay_status.value === 20 && order.delivery_status.value === 10 ? {
|
|
||||||
q: common_vendor.o(($event) => onClickDeliveryOrder(order), index),
|
|
||||||
r: "c1fe0406-13-" + i0 + ",c1fe0406-6",
|
|
||||||
s: common_vendor.p({
|
|
||||||
type: "primary",
|
|
||||||
size: "small"
|
|
||||||
})
|
|
||||||
} : {}) : {}, {
|
|
||||||
t: index
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
s: common_vendor.p({
|
|
||||||
["custom-color"]: "#1a1a1a"
|
|
||||||
}),
|
|
||||||
t: common_vendor.p({
|
|
||||||
["custom-color"]: "#1a1a1a"
|
|
||||||
}),
|
|
||||||
v: common_vendor.sr(paging, "c1fe0406-6", {
|
|
||||||
"k": "paging"
|
|
||||||
}),
|
|
||||||
w: common_vendor.o(apiFetchOrderList),
|
|
||||||
x: common_vendor.o(($event) => dataList.value = $event),
|
|
||||||
y: common_vendor.p({
|
|
||||||
fixed: false,
|
|
||||||
modelValue: dataList.value
|
|
||||||
}),
|
|
||||||
z: orderDetail.address_info
|
|
||||||
}, orderDetail.address_info ? {
|
|
||||||
A: common_vendor.t(orderDetail.address_info.user_name),
|
|
||||||
B: common_vendor.t(orderDetail.address_info.tel_number),
|
|
||||||
C: common_vendor.t(orderDetail.address_info.province_name + orderDetail.address_info.city_name + orderDetail.address_info.county_name + orderDetail.address_info.street_name + orderDetail.address_info.detail_info_new)
|
|
||||||
} : {}, {
|
|
||||||
D: common_vendor.f(orderDetail.goods, (goods, index, i0) => {
|
|
||||||
return {
|
|
||||||
a: common_vendor.t(goods.snapshot_info.degree.degree_name),
|
|
||||||
b: "c1fe0406-19-" + i0 + "," + ("c1fe0406-18-" + i0),
|
|
||||||
c: common_vendor.t(goods.goods_name),
|
|
||||||
d: common_vendor.t(goods.goods_no),
|
|
||||||
e: "c1fe0406-20-" + i0 + "," + ("c1fe0406-18-" + i0),
|
|
||||||
f: common_vendor.p({
|
|
||||||
price: goods.goods_price,
|
|
||||||
size: "small",
|
|
||||||
["need-symbol"]: true
|
|
||||||
}),
|
|
||||||
g: index,
|
|
||||||
h: "c1fe0406-18-" + i0 + ",c1fe0406-17"
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
E: common_vendor.p({
|
|
||||||
["custom-color"]: "#1a1a1a"
|
|
||||||
}),
|
|
||||||
F: common_vendor.p({
|
|
||||||
center: true
|
|
||||||
}),
|
|
||||||
G: common_vendor.p({
|
|
||||||
price: orderDetail.pay_price,
|
|
||||||
size: "normal",
|
|
||||||
["need-symbol"]: true
|
|
||||||
}),
|
|
||||||
H: common_vendor.p({
|
|
||||||
title: "订单编号",
|
|
||||||
desc: orderDetail.order_no
|
|
||||||
}),
|
|
||||||
I: common_vendor.p({
|
|
||||||
title: "下单时间",
|
|
||||||
desc: orderDetail.create_time
|
|
||||||
}),
|
|
||||||
J: common_vendor.o(($event) => form.express_company = $event),
|
|
||||||
K: common_vendor.p({
|
|
||||||
placeholder: "请输入物流公司",
|
|
||||||
type: "text",
|
|
||||||
modelValue: form.express_company
|
|
||||||
}),
|
|
||||||
L: common_vendor.p({
|
|
||||||
label: "物流公司名称"
|
|
||||||
}),
|
|
||||||
M: common_vendor.o(($event) => form.express_no = $event),
|
|
||||||
N: common_vendor.p({
|
|
||||||
placeholder: "请输入物流单号",
|
|
||||||
type: "text",
|
|
||||||
modelValue: form.express_no
|
|
||||||
}),
|
|
||||||
O: common_vendor.p({
|
|
||||||
label: "物流单号"
|
|
||||||
}),
|
|
||||||
P: common_vendor.o(deliveryOrder),
|
|
||||||
Q: common_vendor.p({
|
|
||||||
type: "primary",
|
|
||||||
block: true
|
|
||||||
}),
|
|
||||||
R: common_vendor.o(onCloseDeliveryPopup),
|
|
||||||
S: common_vendor.o(($event) => openDeliveryPopup.value = $event),
|
|
||||||
T: common_vendor.p({
|
|
||||||
["custom-style"]: {
|
|
||||||
height: "65%"
|
|
||||||
},
|
|
||||||
position: "bottom",
|
|
||||||
["safe-area-inset-bottom"]: true,
|
|
||||||
visible: openDeliveryPopup.value
|
|
||||||
})
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-c1fe0406"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/pages/config/shopOrder/index.js.map
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "店铺订单",
|
|
||||||
"usingComponents": {
|
|
||||||
"nut-dialog": "../../../uni_modules/nutui-uni/components/dialog/dialog",
|
|
||||||
"nut-button": "../../../uni_modules/nutui-uni/components/button/button",
|
|
||||||
"nut-searchbar": "../../../uni_modules/nutui-uni/components/searchbar/searchbar",
|
|
||||||
"nut-tabs": "../../../uni_modules/nutui-uni/components/tabs/tabs",
|
|
||||||
"nut-sticky": "../../../uni_modules/nutui-uni/components/sticky/sticky",
|
|
||||||
"nut-tag": "../../../uni_modules/nutui-uni/components/tag/tag",
|
|
||||||
"nut-price": "../../../uni_modules/nutui-uni/components/price/price",
|
|
||||||
"z-paging": "../../../uni_modules/z-paging/components/z-paging/z-paging",
|
|
||||||
"nut-cell": "../../../uni_modules/nutui-uni/components/cell/cell",
|
|
||||||
"nut-cell-group": "../../../uni_modules/nutui-uni/components/cellgroup/cellgroup",
|
|
||||||
"nut-input": "../../../uni_modules/nutui-uni/components/input/input",
|
|
||||||
"nut-form-item": "../../../uni_modules/nutui-uni/components/formitem/formitem",
|
|
||||||
"nut-form": "../../../uni_modules/nutui-uni/components/form/form",
|
|
||||||
"nut-popup": "../../../uni_modules/nutui-uni/components/popup/popup"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because one or more lines are too long
@@ -1,181 +0,0 @@
|
|||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
.page-content.data-v-c1fe0406 {
|
|
||||||
min-height: 100vh;
|
|
||||||
background-color: #f2f3f5;
|
|
||||||
}
|
|
||||||
.order-popup .address-inner.data-v-c1fe0406 {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
.order-popup .total-price-inner.data-v-c1fe0406 {
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.order-popup .total-price-inner view.data-v-c1fe0406:nth-child(2) {
|
|
||||||
color: #fa2c19;
|
|
||||||
}
|
|
||||||
.wechat-img-inner.data-v-c1fe0406 {
|
|
||||||
margin-top: 60rpx;
|
|
||||||
padding: 0rpx 80rpx;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
.order-list.data-v-c1fe0406 {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.order-inner.data-v-c1fe0406 {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
background: #fff;
|
|
||||||
border-radius: 15rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
margin: 20rpx;
|
|
||||||
/* 信息行布局 */
|
|
||||||
}
|
|
||||||
.order-inner .order-inner-header.data-v-c1fe0406 {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
background-color: #dcdcdc;
|
|
||||||
color: rgba(0, 0, 0, 0.5);
|
|
||||||
font-size: 24rpx;
|
|
||||||
justify-content: space-between;
|
|
||||||
line-height: 45rpx;
|
|
||||||
padding: 15rpx 20rpx;
|
|
||||||
}
|
|
||||||
.order-inner .goods-info-row.data-v-c1fe0406 {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
padding: 20rpx;
|
|
||||||
border-bottom: 2rpx solid #f2f3f5;
|
|
||||||
/* 左侧文字样式 */
|
|
||||||
/* 右侧价格样式 */
|
|
||||||
}
|
|
||||||
.order-inner .goods-info-row .left-text.data-v-c1fe0406 {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
.order-inner .goods-info-row .goods-name.data-v-c1fe0406 {
|
|
||||||
font-size: 30rpx;
|
|
||||||
color: #000000;
|
|
||||||
display: block;
|
|
||||||
margin-bottom: 8rpx;
|
|
||||||
}
|
|
||||||
.order-inner .goods-info-row .goods-no.data-v-c1fe0406 {
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #000000;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
.order-inner .goods-info-row .price.data-v-c1fe0406 {
|
|
||||||
margin-left: 20rpx;
|
|
||||||
align-self: center;
|
|
||||||
/* 垂直居中在两行文字之间 */
|
|
||||||
}
|
|
||||||
.order-inner .footer.data-v-c1fe0406 {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
.order-inner .footer .order-inner-price.data-v-c1fe0406 {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
padding-top: 10rpx;
|
|
||||||
padding-right: 20rpx;
|
|
||||||
padding-bottom: 20rpx;
|
|
||||||
font-size: 24rpx;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.order-inner .footer .order-inner-action.data-v-c1fe0406 {
|
|
||||||
display: flex;
|
|
||||||
padding-top: 10rpx;
|
|
||||||
padding-bottom: 30rpx;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-end;
|
|
||||||
}
|
|
||||||
.title-list.data-v-c1fe0406 {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-around;
|
|
||||||
align-items: center;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.title-list .title-item.data-v-c1fe0406 {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-around;
|
|
||||||
align-items: center;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
.title-list .tabs-active.data-v-c1fe0406 {
|
|
||||||
font-weight: bold;
|
|
||||||
color: var(--nut-tabs-titles-item-active-color, var(--nut-title-color, #1a1a1a));
|
|
||||||
opacity: var(--nut-tabs-titles-item-line-opacity, 1);
|
|
||||||
transition: width 0.3s ease;
|
|
||||||
}
|
|
||||||
.title-list .tabs-active .item__line.data-v-c1fe0406 {
|
|
||||||
position: absolute;
|
|
||||||
bottom: -10%;
|
|
||||||
left: 50%;
|
|
||||||
overflow: hidden;
|
|
||||||
content: " ";
|
|
||||||
border-radius: var(--nut-tabs-titles-item-line-border-radius, 0);
|
|
||||||
opacity: var(--nut-tabs-titles-item-line-opacity, 1);
|
|
||||||
transition: width 0.3s ease;
|
|
||||||
transform: translate(-50%, 0);
|
|
||||||
width: var(--nut-tabs-horizontal-titles-item-active-line-width, 40px);
|
|
||||||
height: 3px;
|
|
||||||
content: " ";
|
|
||||||
background: var(--nut-tabs-horizontal-tab-line-color, linear-gradient(90deg, var(--nut-primary-color, #fa2c19) 0%, rgba(250, 44, 25, 0.15) 100%));
|
|
||||||
}
|
|
||||||
305
unpackage/dist/dev/mp-weixin/pages/config/store.js
vendored
305
unpackage/dist/dev/mp-weixin/pages/config/store.js
vendored
@@ -1,305 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
const api_config = require("../../api/config.js");
|
|
||||||
const api_request = require("../../api/request.js");
|
|
||||||
const api_house_order = require("../../api/house_order.js");
|
|
||||||
if (!Array) {
|
|
||||||
const _easycom_nut_cell2 = common_vendor.resolveComponent("nut-cell");
|
|
||||||
const _easycom_nut_cell_group2 = common_vendor.resolveComponent("nut-cell-group");
|
|
||||||
const _easycom_nut_button2 = common_vendor.resolveComponent("nut-button");
|
|
||||||
const _easycom_nut_input2 = common_vendor.resolveComponent("nut-input");
|
|
||||||
const _easycom_nut_form_item2 = common_vendor.resolveComponent("nut-form-item");
|
|
||||||
const _easycom_nut_textarea2 = common_vendor.resolveComponent("nut-textarea");
|
|
||||||
const _easycom_nut_switch2 = common_vendor.resolveComponent("nut-switch");
|
|
||||||
const _easycom_shmily_drag_image2 = common_vendor.resolveComponent("shmily-drag-image");
|
|
||||||
const _easycom_nut_form2 = common_vendor.resolveComponent("nut-form");
|
|
||||||
(_easycom_nut_cell2 + _easycom_nut_cell_group2 + _easycom_nut_button2 + _easycom_nut_input2 + _easycom_nut_form_item2 + _easycom_nut_textarea2 + _easycom_nut_switch2 + _easycom_shmily_drag_image2 + _easycom_nut_form2)();
|
|
||||||
}
|
|
||||||
const _easycom_nut_cell = () => "../../uni_modules/nutui-uni/components/cell/cell.js";
|
|
||||||
const _easycom_nut_cell_group = () => "../../uni_modules/nutui-uni/components/cellgroup/cellgroup.js";
|
|
||||||
const _easycom_nut_button = () => "../../uni_modules/nutui-uni/components/button/button.js";
|
|
||||||
const _easycom_nut_input = () => "../../uni_modules/nutui-uni/components/input/input.js";
|
|
||||||
const _easycom_nut_form_item = () => "../../uni_modules/nutui-uni/components/formitem/formitem.js";
|
|
||||||
const _easycom_nut_textarea = () => "../../uni_modules/nutui-uni/components/textarea/textarea.js";
|
|
||||||
const _easycom_nut_switch = () => "../../uni_modules/nutui-uni/components/switch/switch.js";
|
|
||||||
const _easycom_shmily_drag_image = () => "../../uni_modules/shmily-drag-image/components/shmily-drag-image/shmily-drag-image.js";
|
|
||||||
const _easycom_nut_form = () => "../../uni_modules/nutui-uni/components/form/form.js";
|
|
||||||
if (!Math) {
|
|
||||||
(_easycom_nut_cell + _easycom_nut_cell_group + _easycom_nut_button + _easycom_nut_input + _easycom_nut_form_item + _easycom_nut_textarea + _easycom_nut_switch + _easycom_shmily_drag_image + _easycom_nut_form)();
|
|
||||||
}
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "store",
|
|
||||||
setup(__props) {
|
|
||||||
const isBucket = common_vendor.ref(false);
|
|
||||||
const isAudit = common_vendor.ref(false);
|
|
||||||
const form = common_vendor.reactive({
|
|
||||||
shop_name: "",
|
|
||||||
shop_desc: "",
|
|
||||||
shop_phone: "",
|
|
||||||
is_audit: 0,
|
|
||||||
bulletin_txt: "",
|
|
||||||
service_txt: "",
|
|
||||||
pay_imgs: [],
|
|
||||||
wechat_imgs: [],
|
|
||||||
address_info: {}
|
|
||||||
});
|
|
||||||
const onIsAuditChange = (val) => {
|
|
||||||
form.is_audit = Number(isAudit.value);
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/store.vue:117", form);
|
|
||||||
};
|
|
||||||
const chooseAddress = () => {
|
|
||||||
common_vendor.index.chooseAddress({
|
|
||||||
success(res) {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/store.vue:124", res);
|
|
||||||
form.address_info = {
|
|
||||||
address_id: res.addressID || 1,
|
|
||||||
user_name: res.userName,
|
|
||||||
tel_number: res.telNumber,
|
|
||||||
city_name: res.cityName || "",
|
|
||||||
county_name: res.countyName || "",
|
|
||||||
detail_info: res.detailInfo || "",
|
|
||||||
detail_info_new: res.detailInfoNew || "",
|
|
||||||
national_code: res.nationalCode || "",
|
|
||||||
national_code_full: res.nationalCodeFull || "",
|
|
||||||
postal_code: res.postalCode || "",
|
|
||||||
province_name: res.provinceName || "",
|
|
||||||
street_name: res.streetName || ""
|
|
||||||
};
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const getConfig = () => {
|
|
||||||
api_config.fetchGetConfig().then((res) => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/store.vue:149", "res=====>", res);
|
|
||||||
form.shop_name = res.appConfig.shop_name;
|
|
||||||
form.shop_desc = res.appConfig.shop_desc;
|
|
||||||
form.shop_phone = res.appConfig.shop_phone;
|
|
||||||
form.bulletin_txt = res.appConfig.bulletin_txt;
|
|
||||||
form.service_txt = res.appConfig.service_txt;
|
|
||||||
form.address_info = res.appConfig.address_info;
|
|
||||||
form.is_audit = res.appConfig.is_audit;
|
|
||||||
isAudit.value = res.appConfig.is_audit == 1;
|
|
||||||
if (res.appConfig.bucket) {
|
|
||||||
isBucket.value = true;
|
|
||||||
}
|
|
||||||
let pay_imgs = JSON.parse(res.appConfig.pay_imgs);
|
|
||||||
let wechat_imgs = JSON.parse(res.appConfig.wechat_imgs);
|
|
||||||
pay_imgs.forEach((item) => {
|
|
||||||
form.pay_imgs.push({
|
|
||||||
id: item.image_id,
|
|
||||||
file_path: item.file_path
|
|
||||||
});
|
|
||||||
});
|
|
||||||
wechat_imgs.forEach((item) => {
|
|
||||||
form.wechat_imgs.push({
|
|
||||||
id: item.image_id,
|
|
||||||
file_path: item.file_path
|
|
||||||
});
|
|
||||||
});
|
|
||||||
common_vendor.index.__f__("log", "at pages/config/store.vue:180", "form=====>", form);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const onSubmit = () => {
|
|
||||||
api_config.fetchSetConfig(form).then((res) => {
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
icon: "none",
|
|
||||||
title: "更新商城配置成功"
|
|
||||||
});
|
|
||||||
setTimeout(() => {
|
|
||||||
common_vendor.index.redirectTo({
|
|
||||||
url: "/pages/config/store",
|
|
||||||
success: (res2) => {
|
|
||||||
},
|
|
||||||
fail: () => {
|
|
||||||
},
|
|
||||||
complete: () => {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}, 500);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const saveAddress = () => {
|
|
||||||
api_house_order.houseFetchUpdateAddress({
|
|
||||||
address: form.address_info
|
|
||||||
}).then((res) => {
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
icon: "none",
|
|
||||||
title: "保存收货地址成功"
|
|
||||||
});
|
|
||||||
setTimeout(() => {
|
|
||||||
common_vendor.index.redirectTo({
|
|
||||||
url: "/pages/config/store",
|
|
||||||
success: (res2) => {
|
|
||||||
},
|
|
||||||
fail: () => {
|
|
||||||
},
|
|
||||||
complete: () => {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}, 500);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
common_vendor.onMounted(() => {
|
|
||||||
getConfig();
|
|
||||||
});
|
|
||||||
const addPayImg = () => {
|
|
||||||
common_vendor.index.chooseImage({
|
|
||||||
count: 9 - (form.pay_imgs.length || 0),
|
|
||||||
sourceType: ["album", "camera"],
|
|
||||||
success: (res) => {
|
|
||||||
res.tempFiles.forEach((file) => {
|
|
||||||
common_vendor.index.uploadFile({
|
|
||||||
url: api_request.getUploadImageUrl(),
|
|
||||||
filePath: file.path,
|
|
||||||
name: "iFile",
|
|
||||||
formData: {
|
|
||||||
group_id: 1
|
|
||||||
},
|
|
||||||
success: (res2) => {
|
|
||||||
let data = JSON.parse(res2.data).data;
|
|
||||||
form.pay_imgs.push({
|
|
||||||
id: parseInt(data.file_id),
|
|
||||||
file_path: data.file_path
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const addWechatImg = () => {
|
|
||||||
common_vendor.index.chooseImage({
|
|
||||||
count: 9 - (form.wechat_imgs.length || 0),
|
|
||||||
sourceType: ["album", "camera"],
|
|
||||||
success: (res) => {
|
|
||||||
res.tempFiles.forEach((file) => {
|
|
||||||
common_vendor.index.uploadFile({
|
|
||||||
url: api_request.getUploadImageUrl(),
|
|
||||||
filePath: file.path,
|
|
||||||
name: "iFile",
|
|
||||||
formData: {
|
|
||||||
group_id: 1
|
|
||||||
},
|
|
||||||
success: (res2) => {
|
|
||||||
let data = JSON.parse(res2.data).data;
|
|
||||||
form.wechat_imgs.push({
|
|
||||||
id: parseInt(data.file_id),
|
|
||||||
file_path: data.file_path
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
var _a, _b;
|
|
||||||
return common_vendor.e({
|
|
||||||
a: !((_a = form.address_info) == null ? void 0 : _a.address_id)
|
|
||||||
}, !((_b = form.address_info) == null ? void 0 : _b.address_id) ? {
|
|
||||||
b: common_vendor.o(chooseAddress),
|
|
||||||
c: common_vendor.p({
|
|
||||||
title: "收货地址",
|
|
||||||
["is-link"]: true
|
|
||||||
})
|
|
||||||
} : {
|
|
||||||
d: common_vendor.o(chooseAddress),
|
|
||||||
e: common_vendor.p({
|
|
||||||
title: form.address_info.user_name + " " + form.address_info.tel_number,
|
|
||||||
["is-link"]: true,
|
|
||||||
["sub-title"]: form.address_info.province_name + form.address_info.city_name + form.address_info.county_name + form.address_info.street_name + form.address_info.detail_info_new
|
|
||||||
})
|
|
||||||
}, {
|
|
||||||
f: common_vendor.o(($event) => saveAddress()),
|
|
||||||
g: common_vendor.p({
|
|
||||||
type: "primary",
|
|
||||||
block: true
|
|
||||||
}),
|
|
||||||
h: common_vendor.o(($event) => form.shop_name = $event),
|
|
||||||
i: common_vendor.p({
|
|
||||||
placeholder: "请输入店铺名称",
|
|
||||||
type: "text",
|
|
||||||
modelValue: form.shop_name
|
|
||||||
}),
|
|
||||||
j: common_vendor.p({
|
|
||||||
label: "商城名称"
|
|
||||||
}),
|
|
||||||
k: common_vendor.o(($event) => form.shop_desc = $event),
|
|
||||||
l: common_vendor.p({
|
|
||||||
autosize: true,
|
|
||||||
placeholder: "请输入店铺介绍",
|
|
||||||
type: "text",
|
|
||||||
modelValue: form.shop_desc
|
|
||||||
}),
|
|
||||||
m: common_vendor.p({
|
|
||||||
label: "商城介绍"
|
|
||||||
}),
|
|
||||||
n: common_vendor.o(($event) => form.shop_phone = $event),
|
|
||||||
o: common_vendor.p({
|
|
||||||
placeholder: "请输入手机号码",
|
|
||||||
type: "text",
|
|
||||||
modelValue: form.shop_phone
|
|
||||||
}),
|
|
||||||
p: common_vendor.p({
|
|
||||||
label: "手机号码"
|
|
||||||
}),
|
|
||||||
q: common_vendor.o(($event) => form.bulletin_txt = $event),
|
|
||||||
r: common_vendor.p({
|
|
||||||
autosize: true,
|
|
||||||
placeholder: "请输入首页公告",
|
|
||||||
type: "text",
|
|
||||||
modelValue: form.bulletin_txt
|
|
||||||
}),
|
|
||||||
s: common_vendor.p({
|
|
||||||
label: "首页公告"
|
|
||||||
}),
|
|
||||||
t: common_vendor.o(($event) => form.service_txt = $event),
|
|
||||||
v: common_vendor.p({
|
|
||||||
autosize: true,
|
|
||||||
placeholder: "请输入服务描述",
|
|
||||||
type: "text",
|
|
||||||
modelValue: form.service_txt
|
|
||||||
}),
|
|
||||||
w: common_vendor.p({
|
|
||||||
label: "服务描述"
|
|
||||||
}),
|
|
||||||
x: common_vendor.o(onIsAuditChange),
|
|
||||||
y: common_vendor.o(($event) => isAudit.value = $event),
|
|
||||||
z: common_vendor.p({
|
|
||||||
modelValue: isAudit.value
|
|
||||||
}),
|
|
||||||
A: common_vendor.p({
|
|
||||||
label: "是否审核模式"
|
|
||||||
}),
|
|
||||||
B: isBucket.value
|
|
||||||
}, isBucket.value ? {
|
|
||||||
C: common_vendor.o(($event) => form.pay_imgs = $event),
|
|
||||||
D: common_vendor.p({
|
|
||||||
number: 9,
|
|
||||||
["add-image"]: addPayImg,
|
|
||||||
keyName: "file_path",
|
|
||||||
modelValue: form.pay_imgs
|
|
||||||
})
|
|
||||||
} : {}, {
|
|
||||||
E: isBucket.value
|
|
||||||
}, isBucket.value ? {
|
|
||||||
F: common_vendor.o(($event) => form.wechat_imgs = $event),
|
|
||||||
G: common_vendor.p({
|
|
||||||
number: 9,
|
|
||||||
["add-image"]: addWechatImg,
|
|
||||||
keyName: "file_path",
|
|
||||||
modelValue: form.wechat_imgs
|
|
||||||
})
|
|
||||||
} : {}, {
|
|
||||||
H: common_vendor.o(onSubmit),
|
|
||||||
I: common_vendor.p({
|
|
||||||
type: "primary",
|
|
||||||
block: true
|
|
||||||
})
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-5e515d66"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/config/store.js.map
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "商城配置",
|
|
||||||
"usingComponents": {
|
|
||||||
"nut-cell": "../../uni_modules/nutui-uni/components/cell/cell",
|
|
||||||
"nut-cell-group": "../../uni_modules/nutui-uni/components/cellgroup/cellgroup",
|
|
||||||
"nut-button": "../../uni_modules/nutui-uni/components/button/button",
|
|
||||||
"nut-input": "../../uni_modules/nutui-uni/components/input/input",
|
|
||||||
"nut-form-item": "../../uni_modules/nutui-uni/components/formitem/formitem",
|
|
||||||
"nut-textarea": "../../uni_modules/nutui-uni/components/textarea/textarea",
|
|
||||||
"nut-switch": "../../uni_modules/nutui-uni/components/switch/switch",
|
|
||||||
"shmily-drag-image": "../../uni_modules/shmily-drag-image/components/shmily-drag-image/shmily-drag-image",
|
|
||||||
"nut-form": "../../uni_modules/nutui-uni/components/form/form"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<view class="page-content data-v-5e515d66"><view class="data-v-5e515d66" style="padding:20rpx"><nut-cell-group class="data-v-5e515d66" u-s="{{['d']}}" u-i="5e515d66-0" bind:__l="__l"><nut-cell wx:if="{{a}}" class="data-v-5e515d66" bindclick="{{b}}" u-i="5e515d66-1,5e515d66-0" bind:__l="__l" u-p="{{c}}"></nut-cell><nut-cell wx:else class="data-v-5e515d66" bindclick="{{d}}" u-i="5e515d66-2,5e515d66-0" bind:__l="__l" u-p="{{e||''}}"></nut-cell></nut-cell-group><view class="wechat-img-inner data-v-5e515d66"><nut-button wx:if="{{g}}" class="data-v-5e515d66" u-s="{{['d']}}" bindclick="{{f}}" u-i="5e515d66-3" bind:__l="__l" u-p="{{g}}"> 保存收货地址 </nut-button></view><nut-form class="data-v-5e515d66" u-s="{{['d']}}" u-i="5e515d66-4" bind:__l="__l"><nut-form-item wx:if="{{j}}" class="data-v-5e515d66" u-s="{{['d']}}" u-i="5e515d66-5,5e515d66-4" bind:__l="__l" u-p="{{j}}"><nut-input wx:if="{{i}}" class="nut-input-text data-v-5e515d66" u-i="5e515d66-6,5e515d66-5" bind:__l="__l" bindupdateModelValue="{{h}}" u-p="{{i}}"/></nut-form-item><nut-form-item wx:if="{{m}}" class="data-v-5e515d66" u-s="{{['d']}}" u-i="5e515d66-7,5e515d66-4" bind:__l="__l" u-p="{{m}}"><nut-textarea wx:if="{{l}}" class="data-v-5e515d66" u-i="5e515d66-8,5e515d66-7" bind:__l="__l" bindupdateModelValue="{{k}}" u-p="{{l}}"/></nut-form-item><nut-form-item wx:if="{{p}}" class="data-v-5e515d66" u-s="{{['d']}}" u-i="5e515d66-9,5e515d66-4" bind:__l="__l" u-p="{{p}}"><nut-input wx:if="{{o}}" class="nut-input-text data-v-5e515d66" u-i="5e515d66-10,5e515d66-9" bind:__l="__l" bindupdateModelValue="{{n}}" u-p="{{o}}"/></nut-form-item><nut-form-item wx:if="{{s}}" class="data-v-5e515d66" u-s="{{['d']}}" u-i="5e515d66-11,5e515d66-4" bind:__l="__l" u-p="{{s}}"><nut-textarea wx:if="{{r}}" class="data-v-5e515d66" u-i="5e515d66-12,5e515d66-11" bind:__l="__l" bindupdateModelValue="{{q}}" u-p="{{r}}"/></nut-form-item><nut-form-item wx:if="{{w}}" class="data-v-5e515d66" u-s="{{['d']}}" u-i="5e515d66-13,5e515d66-4" bind:__l="__l" u-p="{{w}}"><nut-textarea wx:if="{{v}}" class="data-v-5e515d66" u-i="5e515d66-14,5e515d66-13" bind:__l="__l" bindupdateModelValue="{{t}}" u-p="{{v}}"/></nut-form-item><nut-form-item wx:if="{{A}}" class="data-v-5e515d66" u-s="{{['d']}}" u-i="5e515d66-15,5e515d66-4" bind:__l="__l" u-p="{{A}}"><nut-switch wx:if="{{z}}" class="data-v-5e515d66" bindchange="{{x}}" u-i="5e515d66-16,5e515d66-15" bind:__l="__l" bindupdateModelValue="{{y}}" u-p="{{z}}"/></nut-form-item><nut-form-item wx:if="{{B}}" class="data-v-5e515d66" u-s="{{['label','d']}}" u-i="5e515d66-17,5e515d66-4" bind:__l="__l"><view slot="label">收款二维码</view><shmily-drag-image class="data-v-5e515d66" u-i="5e515d66-18,5e515d66-17" bind:__l="__l" bindupdateModelValue="{{C}}" u-p="{{D}}"></shmily-drag-image></nut-form-item><nut-form-item wx:if="{{E}}" class="data-v-5e515d66" u-s="{{['label','d']}}" u-i="5e515d66-19,5e515d66-4" bind:__l="__l"><view slot="label">微信二维码</view><shmily-drag-image class="data-v-5e515d66" u-i="5e515d66-20,5e515d66-19" bind:__l="__l" bindupdateModelValue="{{F}}" u-p="{{G}}"></shmily-drag-image></nut-form-item><view class="data-v-5e515d66" style="align-items:center;text-align:center;padding:20rpx 80rpx"><nut-button wx:if="{{I}}" class="data-v-5e515d66" u-s="{{['d']}}" bindclick="{{H}}" u-i="5e515d66-21,5e515d66-4" bind:__l="__l" u-p="{{I}}"> 保存配置 </nut-button></view></nut-form></view></view>
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
.page-content.data-v-5e515d66 {
|
|
||||||
min-height: 100vh;
|
|
||||||
background-color: #f2f3f5;
|
|
||||||
}
|
|
||||||
.wechat-img-inner.data-v-5e515d66 {
|
|
||||||
padding: 0rpx 80rpx;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
.list.data-v-5e515d66 {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
flex-direction: column;
|
|
||||||
background: #ffffff;
|
|
||||||
align-items: center;
|
|
||||||
max-height: 300rpx;
|
|
||||||
overflow-y: scroll;
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
||||||
.list .list-item.data-v-5e515d66 {
|
|
||||||
border-bottom: 1px solid #eee;
|
|
||||||
padding: 20rpx 10rpx;
|
|
||||||
}
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
const api_user = require("../../api/user.js");
|
|
||||||
if (!Array) {
|
|
||||||
const _easycom_nut_button2 = common_vendor.resolveComponent("nut-button");
|
|
||||||
_easycom_nut_button2();
|
|
||||||
}
|
|
||||||
const _easycom_nut_button = () => "../../uni_modules/nutui-uni/components/button/button.js";
|
|
||||||
if (!Math) {
|
|
||||||
_easycom_nut_button();
|
|
||||||
}
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "phoneAuthorization",
|
|
||||||
setup(__props) {
|
|
||||||
const code = common_vendor.ref("");
|
|
||||||
const redirect_url = common_vendor.ref("");
|
|
||||||
common_vendor.onLoad((options) => {
|
|
||||||
redirect_url.value = options.redirect_url;
|
|
||||||
});
|
|
||||||
common_vendor.onMounted(() => {
|
|
||||||
common_vendor.index.login({
|
|
||||||
provider: "weixin",
|
|
||||||
success(res) {
|
|
||||||
if (res.errMsg === "login:ok") {
|
|
||||||
code.value = res.code;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
const getPhoneNumber = (res) => {
|
|
||||||
if (res.detail.code) {
|
|
||||||
api_user.fetchUserPhone(res.detail.code).then((res2) => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/login/phoneAuthorization.vue:54", res2);
|
|
||||||
if (res2.msg === "success" && res2.code === 1) {
|
|
||||||
common_vendor.index.showToast({
|
|
||||||
title: "授权成功",
|
|
||||||
icon: "none"
|
|
||||||
});
|
|
||||||
common_vendor.index.__f__("log", "at pages/login/phoneAuthorization.vue:60", "code");
|
|
||||||
common_vendor.index.switchTab({
|
|
||||||
url: "/pages/mine/index"
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
common_vendor.index.switchTab({
|
|
||||||
url: "/pages/mine/index"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return {
|
|
||||||
a: common_vendor.o(getPhoneNumber),
|
|
||||||
b: common_vendor.p({
|
|
||||||
type: "success",
|
|
||||||
size: "large",
|
|
||||||
["open-type"]: "getPhoneNumber"
|
|
||||||
})
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-9edfa882"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/login/phoneAuthorization.js.map
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "授权手机号",
|
|
||||||
"usingComponents": {
|
|
||||||
"nut-button": "../../uni_modules/nutui-uni/components/button/button"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<view class="tip-infos data-v-9edfa882"><text class="data-v-9edfa882">申请获取以下权限</text><text class="data-v-9edfa882">获得你的手机号信息</text></view><view class="authorize-btn-inner data-v-9edfa882"><nut-button wx:if="{{b}}" class="data-v-9edfa882" u-s="{{['d']}}" bindgetphonenumber="{{a}}" u-i="9edfa882-0" bind:__l="__l" u-p="{{b}}">授权手机号</nut-button></view>
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
.divider.data-v-9edfa882 {
|
|
||||||
height: 1px;
|
|
||||||
background: #eee;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.content.data-v-9edfa882 {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
flex-direction: column;
|
|
||||||
padding: 25px 15px;
|
|
||||||
align-items: center;
|
|
||||||
gap: 20px;
|
|
||||||
}
|
|
||||||
.tip-infos.data-v-9edfa882 {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: flex-start;
|
|
||||||
padding: 10px 25px;
|
|
||||||
gap: 10px;
|
|
||||||
}
|
|
||||||
.tip-infos text.data-v-9edfa882:nth-child(2) {
|
|
||||||
font-size: 15px;
|
|
||||||
color: #666;
|
|
||||||
}
|
|
||||||
.authorize-btn-inner.data-v-9edfa882 {
|
|
||||||
padding: 15px;
|
|
||||||
}
|
|
||||||
109
unpackage/dist/dev/mp-weixin/pages/todo/index.js
vendored
109
unpackage/dist/dev/mp-weixin/pages/todo/index.js
vendored
@@ -1,109 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
const api_index = require("../../api/index.js");
|
|
||||||
const utils_helper = require("../../utils/helper.js");
|
|
||||||
if (!Array) {
|
|
||||||
const _easycom_nut_button2 = common_vendor.resolveComponent("nut-button");
|
|
||||||
const _easycom_nut_tag2 = common_vendor.resolveComponent("nut-tag");
|
|
||||||
const _easycom_z_paging2 = common_vendor.resolveComponent("z-paging");
|
|
||||||
(_easycom_nut_button2 + _easycom_nut_tag2 + _easycom_z_paging2)();
|
|
||||||
}
|
|
||||||
const _easycom_nut_button = () => "../../uni_modules/nutui-uni/components/button/button.js";
|
|
||||||
const _easycom_nut_tag = () => "../../uni_modules/nutui-uni/components/tag/tag.js";
|
|
||||||
const _easycom_z_paging = () => "../../uni_modules/z-paging/components/z-paging/z-paging.js";
|
|
||||||
if (!Math) {
|
|
||||||
(_easycom_nut_button + _easycom_nut_tag + _easycom_z_paging)();
|
|
||||||
}
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "index",
|
|
||||||
setup(__props) {
|
|
||||||
const paging = common_vendor.ref(null);
|
|
||||||
const dataList = common_vendor.ref([]);
|
|
||||||
const queryList = (pageNo, pageSize) => {
|
|
||||||
const params = {
|
|
||||||
pageSize,
|
|
||||||
page: pageNo
|
|
||||||
};
|
|
||||||
common_vendor.index.__f__("log", "at pages/todo/index.vue:91", params);
|
|
||||||
api_index.fetchTodoList(params).then((res) => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/todo/index.vue:93", "res=>", res.list);
|
|
||||||
paging.value.complete(res.list);
|
|
||||||
}).catch((res) => {
|
|
||||||
paging.value.complete(false);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const init = () => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/todo/index.vue:110", "init111");
|
|
||||||
};
|
|
||||||
common_vendor.onShow(() => {
|
|
||||||
common_vendor.index.__f__("log", "at pages/todo/index.vue:132", "onshow---");
|
|
||||||
common_vendor.index.__f__("log", "at pages/todo/index.vue:133", "paging.value", paging.value);
|
|
||||||
if (paging.value) {
|
|
||||||
paging.value.refresh();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
common_vendor.onMounted(() => {
|
|
||||||
init();
|
|
||||||
});
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return {
|
|
||||||
a: common_vendor.o(($event) => common_vendor.unref(utils_helper.navigateTo)("/pages/config/goodsAdd")),
|
|
||||||
b: common_vendor.p({
|
|
||||||
type: "primary",
|
|
||||||
block: true,
|
|
||||||
plain: true
|
|
||||||
}),
|
|
||||||
c: common_vendor.s("top:0px"),
|
|
||||||
d: common_vendor.f(dataList.value, (item, index, i0) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: common_vendor.t(item.user.staff_name),
|
|
||||||
b: "7167769e-2-" + i0 + ",7167769e-0",
|
|
||||||
c: common_vendor.t(item.content),
|
|
||||||
d: item.status.value === 0
|
|
||||||
}, item.status.value === 0 ? {
|
|
||||||
e: common_vendor.t(item.status.text)
|
|
||||||
} : {
|
|
||||||
f: common_vendor.t(item.status.text)
|
|
||||||
}, {
|
|
||||||
g: item.status.value == 0
|
|
||||||
}, item.status.value == 0 ? {
|
|
||||||
h: common_vendor.o(($event) => common_vendor.unref(utils_helper.navigateTo)("/pages/config/goodsEdit?id=" + item.goods_id), index),
|
|
||||||
i: "7167769e-3-" + i0 + ",7167769e-0",
|
|
||||||
j: common_vendor.p({
|
|
||||||
size: "small",
|
|
||||||
type: "success"
|
|
||||||
})
|
|
||||||
} : {}, {
|
|
||||||
k: item.status.value == 1
|
|
||||||
}, item.status.value == 1 ? {
|
|
||||||
l: common_vendor.o(($event) => common_vendor.unref(utils_helper.navigateTo)("/pages/config/goodsEdit?id=" + item.goods_id), index),
|
|
||||||
m: "7167769e-4-" + i0 + ",7167769e-0",
|
|
||||||
n: common_vendor.p({
|
|
||||||
size: "small",
|
|
||||||
type: "danger"
|
|
||||||
})
|
|
||||||
} : {}, {
|
|
||||||
o: index
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
e: common_vendor.p({
|
|
||||||
["custom-color"]: "#1a1a1a"
|
|
||||||
}),
|
|
||||||
f: common_vendor.sr(paging, "7167769e-0", {
|
|
||||||
"k": "paging"
|
|
||||||
}),
|
|
||||||
g: common_vendor.o(queryList),
|
|
||||||
h: common_vendor.o(($event) => dataList.value = $event),
|
|
||||||
i: common_vendor.p({
|
|
||||||
["refresher-enabled"]: false,
|
|
||||||
["auto-clean-list-when-reload"]: false,
|
|
||||||
["auto-scroll-to-top-when-reload"]: false,
|
|
||||||
modelValue: dataList.value
|
|
||||||
})
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-7167769e"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/todo/index.js.map
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "待办",
|
|
||||||
"enablePullDownRefresh": false,
|
|
||||||
"usingComponents": {
|
|
||||||
"nut-button": "../../uni_modules/nutui-uni/components/button/button",
|
|
||||||
"nut-tag": "../../uni_modules/nutui-uni/components/tag/tag",
|
|
||||||
"z-paging": "../../uni_modules/z-paging/components/z-paging/z-paging"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<view class="page-content data-v-7167769e"><z-paging wx:if="{{i}}" class="r data-v-7167769e" u-s="{{['d']}}" u-r="paging" bindquery="{{g}}" u-i="7167769e-0" bind:__l="__l" bindupdateModelValue="{{h}}" u-p="{{i}}"><view class="data-v-7167769e" style="{{'z-index:10000;position:sticky' + ';' + c}}"><view class="top-bar data-v-7167769e"><nut-button wx:if="{{b}}" class="data-v-7167769e" u-s="{{['d']}}" bindclick="{{a}}" u-i="7167769e-1,7167769e-0" bind:__l="__l" u-p="{{b}}"> 新增备忘录 </nut-button></view></view><view wx:for="{{d}}" wx:for-item="item" wx:key="o" class="todo-item data-v-7167769e"><view class="goods-item-content data-v-7167769e"><view class="goods-item-content-header data-v-7167769e"><view class="data-v-7167769e" style="font-size:24rpx">记录人:</view><nut-tag wx:if="{{e}}" class="data-v-7167769e" u-s="{{['d']}}" u-i="{{item.b}}" bind:__l="__l" u-p="{{e}}">{{item.a}}</nut-tag></view><view class="goods-item-content-body data-v-7167769e"><view class="goods-item-content-body-desc data-v-7167769e">{{item.c}}</view></view><view class="goods-item-content-footer data-v-7167769e"><view wx:if="{{item.d}}" class="data-v-7167769e" style="font-size:24rpx;color:red"> 状态:<text class="data-v-7167769e">{{item.e}}</text></view><view wx:else class="data-v-7167769e" style="font-size:24rpx;color:chartreuse"> 状态:<text class="data-v-7167769e">{{item.f}}</text></view><view class="goods-item-content-footer-btn data-v-7167769e"><nut-button wx:if="{{item.g}}" class="data-v-7167769e" u-s="{{['d']}}" bindclick="{{item.h}}" u-i="{{item.i}}" bind:__l="__l" u-p="{{item.j}}"> 标记已办 </nut-button><nut-button wx:if="{{item.k}}" class="data-v-7167769e" u-s="{{['d']}}" bindclick="{{item.l}}" u-i="{{item.m}}" bind:__l="__l" u-p="{{item.n}}"> 标记未办 </nut-button></view></view></view></view></z-paging></view>
|
|
||||||
304
unpackage/dist/dev/mp-weixin/pages/todo/index.wxss
vendored
304
unpackage/dist/dev/mp-weixin/pages/todo/index.wxss
vendored
@@ -1,304 +0,0 @@
|
|||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
.page-content.data-v-7167769e {
|
|
||||||
min-height: 100vh;
|
|
||||||
background-color: #f2f3f5;
|
|
||||||
--nut-menu-bar-box-shadow: none;
|
|
||||||
--nut-menu-item-content-padding: 20rpx;
|
|
||||||
--nut-menu-item-content-max-height: 900rpx;
|
|
||||||
--nut-searchbar-input-height: 40px;
|
|
||||||
}
|
|
||||||
.data-v-7167769e .titleClass .nut-menu__title-text {
|
|
||||||
font-size: 30rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
color: black;
|
|
||||||
}
|
|
||||||
.top-bar.data-v-7167769e {
|
|
||||||
background: #fff;
|
|
||||||
align-items: center;
|
|
||||||
text-align: center;
|
|
||||||
padding: 20rpx 60rpx;
|
|
||||||
}
|
|
||||||
.todo-item.data-v-7167769e {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
padding: 20rpx;
|
|
||||||
background-color: #ffffff;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
gap: 20rpx;
|
|
||||||
}
|
|
||||||
.todo-item .goods-item-content.data-v-7167769e {
|
|
||||||
display: flex;
|
|
||||||
flex: 1;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: space-between;
|
|
||||||
/* 首尾贴边,中间均分 */
|
|
||||||
}
|
|
||||||
.todo-item .goods-item-content .goods-item-content-header.data-v-7167769e {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
padding: 6rpx 0;
|
|
||||||
gap: 20rpx;
|
|
||||||
}
|
|
||||||
.todo-item .goods-item-content .goods-item-content-body.data-v-7167769e {
|
|
||||||
padding: 6rpx 0;
|
|
||||||
}
|
|
||||||
.todo-item .goods-item-content .goods-item-content-body .goods-item-content-body-desc.data-v-7167769e {
|
|
||||||
color: #7c7c7c;
|
|
||||||
font-size: 26rpx;
|
|
||||||
/* 关键属性 */
|
|
||||||
display: -webkit-box;
|
|
||||||
/* 使用弹性盒子布局 */
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
/* 垂直方向排列 */
|
|
||||||
-webkit-line-clamp: 2;
|
|
||||||
/* 限制显示两行 */
|
|
||||||
overflow: hidden;
|
|
||||||
/* 超出部分隐藏 */
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
/* 超出时显示省略号 */
|
|
||||||
}
|
|
||||||
.todo-item .goods-item-content .goods-item-content-stock.data-v-7167769e {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
.todo-item .goods-item-content .goods-item-content-stock .goods-item-content-stock-desc.data-v-7167769e {
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #999999;
|
|
||||||
}
|
|
||||||
.todo-item .goods-item-content .goods-item-content-stock .goods-item-content-status-desc.data-v-7167769e {
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: red;
|
|
||||||
}
|
|
||||||
.todo-item .goods-item-content .goods-item-content-footer.data-v-7167769e {
|
|
||||||
padding: 6rpx 0;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.todo-item .goods-item-content .goods-item-content-footer .goods-item-content-footer-btn.data-v-7167769e {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
gap: 10rpx;
|
|
||||||
}
|
|
||||||
.todo-item .goods-item-content .goods-item-content-footer .goods-item-content-footer-btn .share-btn.data-v-7167769e {
|
|
||||||
border-radius: 50rpx;
|
|
||||||
border: 2rpx solid red;
|
|
||||||
font-size: 26rpx;
|
|
||||||
align-items: center;
|
|
||||||
height: 54rpx;
|
|
||||||
color: red;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
.filter-types.data-v-7167769e {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-start;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
overflow: auto;
|
|
||||||
gap: 10rpx;
|
|
||||||
padding: 10rpx;
|
|
||||||
height: 60rpx;
|
|
||||||
background-color: #fff;
|
|
||||||
border-bottom: 2rpx solid gainsboro;
|
|
||||||
border-top: 2rpx solid gainsboro;
|
|
||||||
}
|
|
||||||
.filter-types .filter-type-inner.data-v-7167769e {
|
|
||||||
align-items: center;
|
|
||||||
background-color: rgba(0, 0, 0, 0.05);
|
|
||||||
border-radius: 16rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
display: flex;
|
|
||||||
flex: 0 0 auto;
|
|
||||||
font-size: 28rpx;
|
|
||||||
gap: 15rpx;
|
|
||||||
padding: 10rpx 20rpx;
|
|
||||||
}
|
|
||||||
.filter-types .filter-type-inner.active.data-v-7167769e {
|
|
||||||
background-color: rgba(250, 44, 25, 0.1);
|
|
||||||
color: var(--nutui-color-primary);
|
|
||||||
}
|
|
||||||
.tabs-container.data-v-7167769e {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
.tabs-container .tab-pane-inner.data-v-7167769e {
|
|
||||||
height: 600rpx;
|
|
||||||
}
|
|
||||||
.tabs-container .tabs-inner.data-v-7167769e {
|
|
||||||
overflow-y: scroll;
|
|
||||||
height: 600rpx;
|
|
||||||
width: 160rpx;
|
|
||||||
background-color: #F5F5F5;
|
|
||||||
}
|
|
||||||
.tabs-container .tabs-inner .tab-inner.data-v-7167769e {
|
|
||||||
display: flex;
|
|
||||||
height: 60rpx;
|
|
||||||
padding: 10rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
background: #F5F5F5;
|
|
||||||
}
|
|
||||||
.tabs-container .tabs-inner .tab-inner text.data-v-7167769e {
|
|
||||||
width: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.tabs-container .tabs-inner .tab-inner-active.data-v-7167769e {
|
|
||||||
background-color: rgba(250, 44, 25, 0.1);
|
|
||||||
color: var(--nutui-color-primary);
|
|
||||||
}
|
|
||||||
.degree-inner.data-v-7167769e {
|
|
||||||
display: flex;
|
|
||||||
flex: 1;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 10rpx;
|
|
||||||
width: 100%;
|
|
||||||
margin-bottom: 60rpx;
|
|
||||||
}
|
|
||||||
.degree-item.data-v-7167769e {
|
|
||||||
align-items: center;
|
|
||||||
background-color: rgba(0, 0, 0, 0.05);
|
|
||||||
border-radius: 10rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
display: flex;
|
|
||||||
flex: 0 0 auto;
|
|
||||||
font-size: 26rpx;
|
|
||||||
gap: 10rpx;
|
|
||||||
justify-content: center;
|
|
||||||
min-height: 80rpx;
|
|
||||||
width: calc(50% - 10rpx);
|
|
||||||
}
|
|
||||||
.degree-item.active.data-v-7167769e {
|
|
||||||
background-color: rgba(250, 44, 25, 0.1);
|
|
||||||
color: var(--nutui-color-primary);
|
|
||||||
}
|
|
||||||
.product-btns.data-v-7167769e {
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
padding: 20rpx 0;
|
|
||||||
}
|
|
||||||
.product-btns .reset.data-v-7167769e {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
.product-btns .confirm.data-v-7167769e {
|
|
||||||
flex: 2;
|
|
||||||
}
|
|
||||||
.degree-btns.data-v-7167769e {
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.degree-btns .reset.data-v-7167769e {
|
|
||||||
flex: 1;
|
|
||||||
/* 重置按钮占 1 份 */
|
|
||||||
}
|
|
||||||
.degree-btns .confirm.data-v-7167769e {
|
|
||||||
flex: 2;
|
|
||||||
/* 确认按钮占 2 份 */
|
|
||||||
}
|
|
||||||
.main-nav-container.data-v-7167769e {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
background-color: #fff;
|
|
||||||
padding: 20rpx;
|
|
||||||
}
|
|
||||||
.nav-button.data-v-7167769e {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
width: 45%;
|
|
||||||
height: 160rpx;
|
|
||||||
border-radius: 20rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
padding: 0 10rpx;
|
|
||||||
}
|
|
||||||
.phone-button.data-v-7167769e {
|
|
||||||
background: linear-gradient(135deg, #6a5ae0, #8d7bfb);
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
.parts-button.data-v-7167769e {
|
|
||||||
background: linear-gradient(135deg, #ff6b6b, #ee5253);
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
.nav-button-bg.data-v-7167769e {
|
|
||||||
position: absolute;
|
|
||||||
right: 0;
|
|
||||||
top: 0;
|
|
||||||
height: 100%;
|
|
||||||
width: 50%;
|
|
||||||
opacity: 0.2;
|
|
||||||
object-fit: cover;
|
|
||||||
}
|
|
||||||
.nav-button-icon.data-v-7167769e {
|
|
||||||
width: 90rpx;
|
|
||||||
height: 90rpx;
|
|
||||||
margin-right: 20rpx;
|
|
||||||
z-index: 2;
|
|
||||||
}
|
|
||||||
.nav-button-content.data-v-7167769e {
|
|
||||||
z-index: 2;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
.nav-button-title.data-v-7167769e {
|
|
||||||
font-size: 34rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-bottom: 8rpx;
|
|
||||||
}
|
|
||||||
.nav-button-desc.data-v-7167769e {
|
|
||||||
font-size: 24rpx;
|
|
||||||
opacity: 0.85;
|
|
||||||
}
|
|
||||||
61
unpackage/dist/dev/mp-weixin/pages/todo/todoAdd.js
vendored
Normal file
61
unpackage/dist/dev/mp-weixin/pages/todo/todoAdd.js
vendored
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
"use strict";
|
||||||
|
const common_vendor = require("../../common/vendor.js");
|
||||||
|
const api_index = require("../../api/index.js");
|
||||||
|
if (!Array) {
|
||||||
|
const _easycom_nut_textarea2 = common_vendor.resolveComponent("nut-textarea");
|
||||||
|
const _easycom_nut_form_item2 = common_vendor.resolveComponent("nut-form-item");
|
||||||
|
const _easycom_nut_button2 = common_vendor.resolveComponent("nut-button");
|
||||||
|
const _easycom_nut_form2 = common_vendor.resolveComponent("nut-form");
|
||||||
|
(_easycom_nut_textarea2 + _easycom_nut_form_item2 + _easycom_nut_button2 + _easycom_nut_form2)();
|
||||||
|
}
|
||||||
|
const _easycom_nut_textarea = () => "../../uni_modules/nutui-uni/components/textarea/textarea.js";
|
||||||
|
const _easycom_nut_form_item = () => "../../uni_modules/nutui-uni/components/formitem/formitem.js";
|
||||||
|
const _easycom_nut_button = () => "../../uni_modules/nutui-uni/components/button/button.js";
|
||||||
|
const _easycom_nut_form = () => "../../uni_modules/nutui-uni/components/form/form.js";
|
||||||
|
if (!Math) {
|
||||||
|
(_easycom_nut_textarea + _easycom_nut_form_item + _easycom_nut_button + _easycom_nut_form)();
|
||||||
|
}
|
||||||
|
const _sfc_main = {
|
||||||
|
__name: "todoAdd",
|
||||||
|
setup(__props) {
|
||||||
|
const form = common_vendor.reactive({
|
||||||
|
content: ""
|
||||||
|
});
|
||||||
|
const onSubmit = () => {
|
||||||
|
common_vendor.index.__f__("log", "at pages/todo/todoAdd.vue:41", "form====>", form);
|
||||||
|
api_index.fetchAddTodo(form).then((res) => {
|
||||||
|
common_vendor.index.showToast({
|
||||||
|
icon: "none",
|
||||||
|
title: "新增待办事项成功"
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
common_vendor.index.switchTab({
|
||||||
|
url: "/pages/todo/todoList"
|
||||||
|
});
|
||||||
|
}, 500);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
return (_ctx, _cache) => {
|
||||||
|
return {
|
||||||
|
a: common_vendor.o(($event) => form.content = $event),
|
||||||
|
b: common_vendor.p({
|
||||||
|
rows: 3,
|
||||||
|
placeholder: "请输入待办事项",
|
||||||
|
type: "text",
|
||||||
|
modelValue: form.content
|
||||||
|
}),
|
||||||
|
c: common_vendor.p({
|
||||||
|
label: "待办事项"
|
||||||
|
}),
|
||||||
|
d: common_vendor.o(onSubmit),
|
||||||
|
e: common_vendor.p({
|
||||||
|
type: "primary",
|
||||||
|
block: true
|
||||||
|
})
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-2d99a30c"]]);
|
||||||
|
wx.createPage(MiniProgramPage);
|
||||||
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/todo/todoAdd.js.map
|
||||||
10
unpackage/dist/dev/mp-weixin/pages/todo/todoAdd.json
vendored
Normal file
10
unpackage/dist/dev/mp-weixin/pages/todo/todoAdd.json
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"navigationBarTitleText": "添加待办事项",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"usingComponents": {
|
||||||
|
"nut-textarea": "../../uni_modules/nutui-uni/components/textarea/textarea",
|
||||||
|
"nut-form-item": "../../uni_modules/nutui-uni/components/formitem/formitem",
|
||||||
|
"nut-button": "../../uni_modules/nutui-uni/components/button/button",
|
||||||
|
"nut-form": "../../uni_modules/nutui-uni/components/form/form"
|
||||||
|
}
|
||||||
|
}
|
||||||
1
unpackage/dist/dev/mp-weixin/pages/todo/todoAdd.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/todo/todoAdd.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<view class="page-content data-v-2d99a30c"><view class="data-v-2d99a30c" style="padding:20rpx"><nut-form class="data-v-2d99a30c" u-s="{{['d']}}" u-i="2d99a30c-0" bind:__l="__l"><nut-form-item wx:if="{{c}}" class="data-v-2d99a30c" u-s="{{['d']}}" u-i="2d99a30c-1,2d99a30c-0" bind:__l="__l" u-p="{{c}}"><nut-textarea wx:if="{{b}}" class="data-v-2d99a30c" u-i="2d99a30c-2,2d99a30c-1" bind:__l="__l" bindupdateModelValue="{{a}}" u-p="{{b}}"/></nut-form-item><view class="data-v-2d99a30c" style="align-items:center;text-align:center;padding:20rpx 60rpx"><nut-button wx:if="{{e}}" class="data-v-2d99a30c" u-s="{{['d']}}" bindclick="{{d}}" u-i="2d99a30c-3,2d99a30c-0" bind:__l="__l" u-p="{{e}}"> 新增待办事项 </nut-button></view></nut-form></view></view>
|
||||||
@@ -48,8 +48,7 @@
|
|||||||
/* 垂直间距 */
|
/* 垂直间距 */
|
||||||
/* 透明度 */
|
/* 透明度 */
|
||||||
/* 文章场景相关 */
|
/* 文章场景相关 */
|
||||||
.page-content.data-v-a30aee39 {
|
.page-content.data-v-2d99a30c {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background-color: #f2f3f5;
|
background-color: #f2f3f5;
|
||||||
--nut-searchbar-input-height: 40px;
|
|
||||||
}
|
}
|
||||||
114
unpackage/dist/dev/mp-weixin/pages/todo/todoList.js
vendored
114
unpackage/dist/dev/mp-weixin/pages/todo/todoList.js
vendored
@@ -4,40 +4,68 @@ const api_index = require("../../api/index.js");
|
|||||||
const utils_helper = require("../../utils/helper.js");
|
const utils_helper = require("../../utils/helper.js");
|
||||||
if (!Array) {
|
if (!Array) {
|
||||||
const _easycom_nut_button2 = common_vendor.resolveComponent("nut-button");
|
const _easycom_nut_button2 = common_vendor.resolveComponent("nut-button");
|
||||||
const _easycom_nut_tag2 = common_vendor.resolveComponent("nut-tag");
|
|
||||||
const _easycom_z_paging2 = common_vendor.resolveComponent("z-paging");
|
const _easycom_z_paging2 = common_vendor.resolveComponent("z-paging");
|
||||||
(_easycom_nut_button2 + _easycom_nut_tag2 + _easycom_z_paging2)();
|
const _easycom_nut_popup2 = common_vendor.resolveComponent("nut-popup");
|
||||||
|
(_easycom_nut_button2 + _easycom_z_paging2 + _easycom_nut_popup2)();
|
||||||
}
|
}
|
||||||
const _easycom_nut_button = () => "../../uni_modules/nutui-uni/components/button/button.js";
|
const _easycom_nut_button = () => "../../uni_modules/nutui-uni/components/button/button.js";
|
||||||
const _easycom_nut_tag = () => "../../uni_modules/nutui-uni/components/tag/tag.js";
|
|
||||||
const _easycom_z_paging = () => "../../uni_modules/z-paging/components/z-paging/z-paging.js";
|
const _easycom_z_paging = () => "../../uni_modules/z-paging/components/z-paging/z-paging.js";
|
||||||
|
const _easycom_nut_popup = () => "../../uni_modules/nutui-uni/components/popup/popup.js";
|
||||||
if (!Math) {
|
if (!Math) {
|
||||||
(_easycom_nut_button + _easycom_nut_tag + _easycom_z_paging)();
|
(_easycom_nut_button + _easycom_z_paging + _easycom_nut_popup)();
|
||||||
}
|
}
|
||||||
const _sfc_main = {
|
const _sfc_main = {
|
||||||
__name: "todoList",
|
__name: "todoList",
|
||||||
setup(__props) {
|
setup(__props) {
|
||||||
|
const tempTodo = common_vendor.reactive({});
|
||||||
|
const visibleInfoPopup = common_vendor.ref(false);
|
||||||
|
const onShowInfoPopup = (todo) => {
|
||||||
|
common_vendor.index.__f__("log", "at pages/todo/todoList.vue:88", "----", todo);
|
||||||
|
Object.assign(tempTodo, todo);
|
||||||
|
visibleInfoPopup.value = true;
|
||||||
|
};
|
||||||
|
const onCloseInfoPopup = () => {
|
||||||
|
Object.assign(tempTodo, {});
|
||||||
|
visibleInfoPopup.value = false;
|
||||||
|
common_vendor.index.__f__("log", "at pages/todo/todoList.vue:95", "关闭");
|
||||||
|
};
|
||||||
const paging = common_vendor.ref(null);
|
const paging = common_vendor.ref(null);
|
||||||
const dataList = common_vendor.ref([]);
|
const dataList = common_vendor.ref([]);
|
||||||
|
const onMark = (id, status) => {
|
||||||
|
const params = {
|
||||||
|
id,
|
||||||
|
status
|
||||||
|
};
|
||||||
|
common_vendor.index.__f__("log", "at pages/todo/todoList.vue:108", params);
|
||||||
|
api_index.fetchEditTodo(params).then((res) => {
|
||||||
|
common_vendor.index.showToast({
|
||||||
|
title: "标记成功",
|
||||||
|
icon: "success"
|
||||||
|
});
|
||||||
|
paging.value.refresh();
|
||||||
|
}).catch((res) => {
|
||||||
|
paging.value.refresh();
|
||||||
|
});
|
||||||
|
};
|
||||||
const queryList = (pageNo, pageSize) => {
|
const queryList = (pageNo, pageSize) => {
|
||||||
const params = {
|
const params = {
|
||||||
pageSize,
|
pageSize,
|
||||||
page: pageNo
|
page: pageNo
|
||||||
};
|
};
|
||||||
common_vendor.index.__f__("log", "at pages/todo/todoList.vue:91", params);
|
common_vendor.index.__f__("log", "at pages/todo/todoList.vue:129", params);
|
||||||
api_index.fetchTodoList(params).then((res) => {
|
api_index.fetchTodoList(params).then((res) => {
|
||||||
common_vendor.index.__f__("log", "at pages/todo/todoList.vue:93", "res=>", res.list);
|
common_vendor.index.__f__("log", "at pages/todo/todoList.vue:131", "res=>", res.list);
|
||||||
paging.value.complete(res.list);
|
paging.value.complete(res.list);
|
||||||
}).catch((res) => {
|
}).catch((res) => {
|
||||||
paging.value.complete(false);
|
paging.value.complete(false);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const init = () => {
|
const init = () => {
|
||||||
common_vendor.index.__f__("log", "at pages/todo/todoList.vue:106", "init111");
|
common_vendor.index.__f__("log", "at pages/todo/todoList.vue:142", "init111");
|
||||||
};
|
};
|
||||||
common_vendor.onShow(() => {
|
common_vendor.onShow(() => {
|
||||||
common_vendor.index.__f__("log", "at pages/todo/todoList.vue:128", "onshow---");
|
common_vendor.index.__f__("log", "at pages/todo/todoList.vue:146", "onshow---");
|
||||||
common_vendor.index.__f__("log", "at pages/todo/todoList.vue:129", "paging.value", paging.value);
|
common_vendor.index.__f__("log", "at pages/todo/todoList.vue:147", "paging.value", paging.value);
|
||||||
if (paging.value) {
|
if (paging.value) {
|
||||||
paging.value.refresh();
|
paging.value.refresh();
|
||||||
}
|
}
|
||||||
@@ -46,8 +74,9 @@ const _sfc_main = {
|
|||||||
init();
|
init();
|
||||||
});
|
});
|
||||||
return (_ctx, _cache) => {
|
return (_ctx, _cache) => {
|
||||||
return {
|
var _a;
|
||||||
a: common_vendor.o(($event) => common_vendor.unref(utils_helper.navigateTo)("/pages/config/goodsAdd")),
|
return common_vendor.e({
|
||||||
|
a: common_vendor.o(($event) => common_vendor.unref(utils_helper.navigateTo)("/pages/todo/todoAdd")),
|
||||||
b: common_vendor.p({
|
b: common_vendor.p({
|
||||||
type: "primary",
|
type: "primary",
|
||||||
block: true,
|
block: true,
|
||||||
@@ -57,50 +86,69 @@ const _sfc_main = {
|
|||||||
d: common_vendor.f(dataList.value, (item, index, i0) => {
|
d: common_vendor.f(dataList.value, (item, index, i0) => {
|
||||||
return common_vendor.e({
|
return common_vendor.e({
|
||||||
a: common_vendor.t(item.user.staff_name),
|
a: common_vendor.t(item.user.staff_name),
|
||||||
b: "2f35fb20-2-" + i0 + ",2f35fb20-0",
|
b: common_vendor.t(item.create_time),
|
||||||
c: common_vendor.t(item.content),
|
c: common_vendor.o(($event) => onShowInfoPopup(item), index),
|
||||||
d: item.status.value === 0
|
d: common_vendor.t(item.content),
|
||||||
|
e: common_vendor.o(($event) => onShowInfoPopup(item), index),
|
||||||
|
f: item.status.value === 0
|
||||||
}, item.status.value === 0 ? {
|
}, item.status.value === 0 ? {
|
||||||
e: common_vendor.t(item.status.text)
|
g: common_vendor.t(item.status.text)
|
||||||
} : {
|
} : {
|
||||||
f: common_vendor.t(item.status.text)
|
h: common_vendor.t(item.status.text)
|
||||||
}, {
|
}, {
|
||||||
g: item.status.value == 0
|
i: item.status.value == 0
|
||||||
}, item.status.value == 0 ? {
|
}, item.status.value == 0 ? {
|
||||||
h: common_vendor.o(($event) => _ctx.onMark(item.goods_id, "1"), index),
|
j: common_vendor.o(($event) => onMark(item.id, "1"), index),
|
||||||
i: "2f35fb20-3-" + i0 + ",2f35fb20-0",
|
k: "2f35fb20-2-" + i0 + ",2f35fb20-0",
|
||||||
j: common_vendor.p({
|
l: common_vendor.p({
|
||||||
size: "small",
|
size: "small",
|
||||||
type: "success"
|
type: "success"
|
||||||
})
|
})
|
||||||
} : {}, {
|
} : {}, {
|
||||||
k: item.status.value == 1
|
m: item.status.value == 1
|
||||||
}, item.status.value == 1 ? {
|
}, item.status.value == 1 ? {
|
||||||
l: common_vendor.o(($event) => _ctx.onMark(item.goods_id, "0"), index),
|
n: common_vendor.o(($event) => onMark(item.id, "0"), index),
|
||||||
m: "2f35fb20-4-" + i0 + ",2f35fb20-0",
|
o: "2f35fb20-3-" + i0 + ",2f35fb20-0",
|
||||||
n: common_vendor.p({
|
p: common_vendor.p({
|
||||||
size: "small",
|
size: "small",
|
||||||
type: "danger"
|
type: "danger"
|
||||||
})
|
})
|
||||||
} : {}, {
|
} : {}, {
|
||||||
o: index
|
q: index
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
e: common_vendor.p({
|
e: common_vendor.sr(paging, "2f35fb20-0", {
|
||||||
["custom-color"]: "#1a1a1a"
|
|
||||||
}),
|
|
||||||
f: common_vendor.sr(paging, "2f35fb20-0", {
|
|
||||||
"k": "paging"
|
"k": "paging"
|
||||||
}),
|
}),
|
||||||
g: common_vendor.o(queryList),
|
f: common_vendor.o(queryList),
|
||||||
h: common_vendor.o(($event) => dataList.value = $event),
|
g: common_vendor.o(($event) => dataList.value = $event),
|
||||||
i: common_vendor.p({
|
h: common_vendor.p({
|
||||||
["refresher-enabled"]: false,
|
["refresher-enabled"]: false,
|
||||||
["auto-clean-list-when-reload"]: false,
|
["auto-clean-list-when-reload"]: false,
|
||||||
["auto-scroll-to-top-when-reload"]: false,
|
["auto-scroll-to-top-when-reload"]: false,
|
||||||
modelValue: dataList.value
|
modelValue: dataList.value
|
||||||
|
}),
|
||||||
|
i: common_vendor.t((_a = tempTodo == null ? void 0 : tempTodo.user) == null ? void 0 : _a.staff_name),
|
||||||
|
j: tempTodo == null ? void 0 : tempTodo.content
|
||||||
|
}, (tempTodo == null ? void 0 : tempTodo.content) ? {
|
||||||
|
k: common_vendor.t(tempTodo.content)
|
||||||
|
} : {}, {
|
||||||
|
l: tempTodo == null ? void 0 : tempTodo.create_time
|
||||||
|
}, (tempTodo == null ? void 0 : tempTodo.create_time) ? {
|
||||||
|
m: common_vendor.t(tempTodo.create_time)
|
||||||
|
} : {}, {
|
||||||
|
n: common_vendor.o(onCloseInfoPopup),
|
||||||
|
o: common_vendor.o(($event) => visibleInfoPopup.value = $event),
|
||||||
|
p: common_vendor.p({
|
||||||
|
["custom-style"]: {
|
||||||
|
height: "50%"
|
||||||
|
},
|
||||||
|
position: "bottom",
|
||||||
|
["safe-area-inset-bottom"]: true,
|
||||||
|
["close-on-click-overlay"]: true,
|
||||||
|
visible: visibleInfoPopup.value
|
||||||
})
|
})
|
||||||
};
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"navigationBarTitleText": "待办",
|
"navigationBarTitleText": "待办事项",
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": false,
|
||||||
"usingComponents": {
|
"usingComponents": {
|
||||||
"nut-button": "../../uni_modules/nutui-uni/components/button/button",
|
"nut-button": "../../uni_modules/nutui-uni/components/button/button",
|
||||||
"nut-tag": "../../uni_modules/nutui-uni/components/tag/tag",
|
"z-paging": "../../uni_modules/z-paging/components/z-paging/z-paging",
|
||||||
"z-paging": "../../uni_modules/z-paging/components/z-paging/z-paging"
|
"nut-popup": "../../uni_modules/nutui-uni/components/popup/popup"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1 +1 @@
|
|||||||
<view class="page-content data-v-2f35fb20"><z-paging wx:if="{{i}}" class="r data-v-2f35fb20" u-s="{{['d']}}" u-r="paging" bindquery="{{g}}" u-i="2f35fb20-0" bind:__l="__l" bindupdateModelValue="{{h}}" u-p="{{i}}"><view class="data-v-2f35fb20" style="{{'z-index:10000;position:sticky' + ';' + c}}"><view class="top-bar data-v-2f35fb20"><nut-button wx:if="{{b}}" class="data-v-2f35fb20" u-s="{{['d']}}" bindclick="{{a}}" u-i="2f35fb20-1,2f35fb20-0" bind:__l="__l" u-p="{{b}}"> 新增备忘录 </nut-button></view></view><view wx:for="{{d}}" wx:for-item="item" wx:key="o" class="todo-item data-v-2f35fb20"><view class="goods-item-content data-v-2f35fb20"><view class="goods-item-content-header data-v-2f35fb20"><view class="data-v-2f35fb20" style="font-size:24rpx">记录人:</view><nut-tag wx:if="{{e}}" class="data-v-2f35fb20" u-s="{{['d']}}" u-i="{{item.b}}" bind:__l="__l" u-p="{{e}}">{{item.a}}</nut-tag></view><view class="goods-item-content-body data-v-2f35fb20"><view class="goods-item-content-body-desc data-v-2f35fb20">{{item.c}}</view></view><view class="goods-item-content-footer data-v-2f35fb20"><view wx:if="{{item.d}}" class="data-v-2f35fb20" style="font-size:24rpx;color:red"> 状态:<text class="data-v-2f35fb20">{{item.e}}</text></view><view wx:else class="data-v-2f35fb20" style="font-size:24rpx;color:chartreuse"> 状态:<text class="data-v-2f35fb20">{{item.f}}</text></view><view class="goods-item-content-footer-btn data-v-2f35fb20"><nut-button wx:if="{{item.g}}" class="data-v-2f35fb20" u-s="{{['d']}}" bindclick="{{item.h}}" u-i="{{item.i}}" bind:__l="__l" u-p="{{item.j}}"> 标记已办 </nut-button><nut-button wx:if="{{item.k}}" class="data-v-2f35fb20" u-s="{{['d']}}" bindclick="{{item.l}}" u-i="{{item.m}}" bind:__l="__l" u-p="{{item.n}}"> 标记未办 </nut-button></view></view></view></view></z-paging></view>
|
<view class="page-content data-v-2f35fb20"><z-paging wx:if="{{h}}" class="r data-v-2f35fb20" u-s="{{['d']}}" u-r="paging" bindquery="{{f}}" u-i="2f35fb20-0" bind:__l="__l" bindupdateModelValue="{{g}}" u-p="{{h}}"><view class="data-v-2f35fb20" style="{{'z-index:10000;position:sticky' + ';' + c}}"><view class="top-bar data-v-2f35fb20"><nut-button wx:if="{{b}}" class="data-v-2f35fb20" u-s="{{['d']}}" bindclick="{{a}}" u-i="2f35fb20-1,2f35fb20-0" bind:__l="__l" u-p="{{b}}"> 添加待办事项 </nut-button></view></view><view wx:for="{{d}}" wx:for-item="item" wx:key="q" class="todo-item data-v-2f35fb20"><view class="todo-item-content data-v-2f35fb20"><view class="todo-item-content-header data-v-2f35fb20" bindtap="{{item.c}}"><view class="data-v-2f35fb20" style="font-size:24rpx"> 记录人: {{item.a}}</view><view class="data-v-2f35fb20" style="font-size:24rpx"> 记录时间: {{item.b}}</view></view><view class="todo-item-content-body data-v-2f35fb20" bindtap="{{item.e}}"><view class="todo-item-content-body-desc data-v-2f35fb20">{{item.d}}</view></view><view class="todo-item-content-footer data-v-2f35fb20"><view wx:if="{{item.f}}" class="data-v-2f35fb20" style="font-size:24rpx;color:red"> 状态:<text class="data-v-2f35fb20">{{item.g}}</text></view><view wx:else class="data-v-2f35fb20" style="font-size:24rpx;color:chartreuse"> 状态:<text class="data-v-2f35fb20">{{item.h}}</text></view><view class="todo-item-content-footer-btn data-v-2f35fb20"><nut-button wx:if="{{item.i}}" class="data-v-2f35fb20" u-s="{{['d']}}" bindclick="{{item.j}}" u-i="{{item.k}}" bind:__l="__l" u-p="{{item.l}}"> 标记已办 </nut-button><nut-button wx:if="{{item.m}}" class="data-v-2f35fb20" u-s="{{['d']}}" bindclick="{{item.n}}" u-i="{{item.o}}" bind:__l="__l" u-p="{{item.p}}"> 标记未办 </nut-button></view></view></view></view></z-paging><nut-popup wx:if="{{p}}" class="data-v-2f35fb20" u-s="{{['d']}}" bindclose="{{n}}" u-i="2f35fb20-4" bind:__l="__l" bindupdateVisible="{{o}}" u-p="{{p}}"><view class="data-v-2f35fb20"><view class="title data-v-2f35fb20">记录人: {{i}}</view><view class="room-info data-v-2f35fb20"><view wx:if="{{j}}" class="remark data-v-2f35fb20">待办事项: {{k}}</view><view wx:if="{{l}}" class="room-id data-v-2f35fb20">添加时间: {{m}}</view></view></view></nut-popup></view>
|
||||||
@@ -51,15 +51,6 @@
|
|||||||
.page-content.data-v-2f35fb20 {
|
.page-content.data-v-2f35fb20 {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background-color: #f2f3f5;
|
background-color: #f2f3f5;
|
||||||
--nut-menu-bar-box-shadow: none;
|
|
||||||
--nut-menu-item-content-padding: 20rpx;
|
|
||||||
--nut-menu-item-content-max-height: 900rpx;
|
|
||||||
--nut-searchbar-input-height: 40px;
|
|
||||||
}
|
|
||||||
.data-v-2f35fb20 .titleClass .nut-menu__title-text {
|
|
||||||
font-size: 30rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
color: black;
|
|
||||||
}
|
}
|
||||||
.top-bar.data-v-2f35fb20 {
|
.top-bar.data-v-2f35fb20 {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
@@ -77,228 +68,61 @@
|
|||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
gap: 20rpx;
|
gap: 20rpx;
|
||||||
}
|
}
|
||||||
.todo-item .goods-item-content.data-v-2f35fb20 {
|
.todo-item .todo-item-content.data-v-2f35fb20 {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
/* 首尾贴边,中间均分 */
|
/* 首尾贴边,中间均分 */
|
||||||
}
|
}
|
||||||
.todo-item .goods-item-content .goods-item-content-header.data-v-2f35fb20 {
|
.todo-item .todo-item-content .todo-item-content-header.data-v-2f35fb20 {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 6rpx 0;
|
padding: 6rpx 0;
|
||||||
gap: 20rpx;
|
gap: 20rpx;
|
||||||
}
|
}
|
||||||
.todo-item .goods-item-content .goods-item-content-body.data-v-2f35fb20 {
|
.todo-item .todo-item-content .todo-item-content-body.data-v-2f35fb20 {
|
||||||
padding: 6rpx 0;
|
padding: 6rpx 0;
|
||||||
}
|
}
|
||||||
.todo-item .goods-item-content .goods-item-content-body .goods-item-content-body-desc.data-v-2f35fb20 {
|
.todo-item .todo-item-content .todo-item-content-body .todo-item-content-body-desc.data-v-2f35fb20 {
|
||||||
color: #7c7c7c;
|
color: #7c7c7c;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
/* 关键属性 */
|
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
/* 使用弹性盒子布局 */
|
|
||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
/* 垂直方向排列 */
|
|
||||||
-webkit-line-clamp: 2;
|
-webkit-line-clamp: 2;
|
||||||
/* 限制显示两行 */
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
/* 超出部分隐藏 */
|
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
/* 超出时显示省略号 */
|
|
||||||
}
|
}
|
||||||
.todo-item .goods-item-content .goods-item-content-stock.data-v-2f35fb20 {
|
.todo-item .todo-item-content .todo-item-content-footer.data-v-2f35fb20 {
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
.todo-item .goods-item-content .goods-item-content-stock .goods-item-content-stock-desc.data-v-2f35fb20 {
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #999999;
|
|
||||||
}
|
|
||||||
.todo-item .goods-item-content .goods-item-content-stock .goods-item-content-status-desc.data-v-2f35fb20 {
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: red;
|
|
||||||
}
|
|
||||||
.todo-item .goods-item-content .goods-item-content-footer.data-v-2f35fb20 {
|
|
||||||
padding: 6rpx 0;
|
padding: 6rpx 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
.todo-item .goods-item-content .goods-item-content-footer .goods-item-content-footer-btn.data-v-2f35fb20 {
|
.todo-item .todo-item-content .todo-item-content-footer .todo-item-content-footer-btn.data-v-2f35fb20 {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 10rpx;
|
gap: 10rpx;
|
||||||
}
|
}
|
||||||
.todo-item .goods-item-content .goods-item-content-footer .goods-item-content-footer-btn .share-btn.data-v-2f35fb20 {
|
.title.data-v-2f35fb20 {
|
||||||
border-radius: 50rpx;
|
padding: 0 20rpx;
|
||||||
border: 2rpx solid red;
|
margin-top: 20rpx;
|
||||||
font-size: 26rpx;
|
margin-bottom: 20rpx;
|
||||||
align-items: center;
|
|
||||||
height: 54rpx;
|
|
||||||
color: red;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
.filter-types.data-v-2f35fb20 {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-start;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
overflow: auto;
|
|
||||||
gap: 10rpx;
|
|
||||||
padding: 10rpx;
|
|
||||||
height: 60rpx;
|
|
||||||
background-color: #fff;
|
|
||||||
border-bottom: 2rpx solid gainsboro;
|
|
||||||
border-top: 2rpx solid gainsboro;
|
|
||||||
}
|
|
||||||
.filter-types .filter-type-inner.data-v-2f35fb20 {
|
|
||||||
align-items: center;
|
|
||||||
background-color: rgba(0, 0, 0, 0.05);
|
|
||||||
border-radius: 16rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
display: flex;
|
|
||||||
flex: 0 0 auto;
|
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
gap: 15rpx;
|
font-weight: 400;
|
||||||
padding: 10rpx 20rpx;
|
|
||||||
}
|
|
||||||
.filter-types .filter-type-inner.active.data-v-2f35fb20 {
|
|
||||||
background-color: rgba(250, 44, 25, 0.1);
|
|
||||||
color: var(--nutui-color-primary);
|
|
||||||
}
|
|
||||||
.tabs-container.data-v-2f35fb20 {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
.tabs-container .tab-pane-inner.data-v-2f35fb20 {
|
|
||||||
height: 600rpx;
|
|
||||||
}
|
|
||||||
.tabs-container .tabs-inner.data-v-2f35fb20 {
|
|
||||||
overflow-y: scroll;
|
|
||||||
height: 600rpx;
|
|
||||||
width: 160rpx;
|
|
||||||
background-color: #F5F5F5;
|
|
||||||
}
|
|
||||||
.tabs-container .tabs-inner .tab-inner.data-v-2f35fb20 {
|
|
||||||
display: flex;
|
|
||||||
height: 60rpx;
|
|
||||||
padding: 10rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
background: #F5F5F5;
|
|
||||||
}
|
|
||||||
.tabs-container .tabs-inner .tab-inner text.data-v-2f35fb20 {
|
|
||||||
width: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.tabs-container .tabs-inner .tab-inner-active.data-v-2f35fb20 {
|
.room-info.data-v-2f35fb20 {
|
||||||
background-color: rgba(250, 44, 25, 0.1);
|
text-align: left;
|
||||||
color: var(--nutui-color-primary);
|
padding: 20rpx 20rpx;
|
||||||
}
|
color: #666;
|
||||||
.degree-inner.data-v-2f35fb20 {
|
|
||||||
display: flex;
|
|
||||||
flex: 1;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 10rpx;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-bottom: 60rpx;
|
|
||||||
}
|
|
||||||
.degree-item.data-v-2f35fb20 {
|
|
||||||
align-items: center;
|
|
||||||
background-color: rgba(0, 0, 0, 0.05);
|
|
||||||
border-radius: 10rpx;
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
display: flex;
|
}
|
||||||
flex: 0 0 auto;
|
.room-info .room-id.data-v-2f35fb20 {
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
.room-info .remark.data-v-2f35fb20 {
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
gap: 10rpx;
|
|
||||||
justify-content: center;
|
|
||||||
min-height: 80rpx;
|
|
||||||
width: calc(50% - 10rpx);
|
|
||||||
}
|
|
||||||
.degree-item.active.data-v-2f35fb20 {
|
|
||||||
background-color: rgba(250, 44, 25, 0.1);
|
|
||||||
color: var(--nutui-color-primary);
|
|
||||||
}
|
|
||||||
.product-btns.data-v-2f35fb20 {
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
padding: 20rpx 0;
|
|
||||||
}
|
|
||||||
.product-btns .reset.data-v-2f35fb20 {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
.product-btns .confirm.data-v-2f35fb20 {
|
|
||||||
flex: 2;
|
|
||||||
}
|
|
||||||
.degree-btns.data-v-2f35fb20 {
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.degree-btns .reset.data-v-2f35fb20 {
|
|
||||||
flex: 1;
|
|
||||||
/* 重置按钮占 1 份 */
|
|
||||||
}
|
|
||||||
.degree-btns .confirm.data-v-2f35fb20 {
|
|
||||||
flex: 2;
|
|
||||||
/* 确认按钮占 2 份 */
|
|
||||||
}
|
|
||||||
.main-nav-container.data-v-2f35fb20 {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
background-color: #fff;
|
|
||||||
padding: 20rpx;
|
|
||||||
}
|
|
||||||
.nav-button.data-v-2f35fb20 {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
width: 45%;
|
|
||||||
height: 160rpx;
|
|
||||||
border-radius: 20rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
padding: 0 10rpx;
|
|
||||||
}
|
|
||||||
.phone-button.data-v-2f35fb20 {
|
|
||||||
background: linear-gradient(135deg, #6a5ae0, #8d7bfb);
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
.parts-button.data-v-2f35fb20 {
|
|
||||||
background: linear-gradient(135deg, #ff6b6b, #ee5253);
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
.nav-button-bg.data-v-2f35fb20 {
|
|
||||||
position: absolute;
|
|
||||||
right: 0;
|
|
||||||
top: 0;
|
|
||||||
height: 100%;
|
|
||||||
width: 50%;
|
|
||||||
opacity: 0.2;
|
|
||||||
object-fit: cover;
|
|
||||||
}
|
|
||||||
.nav-button-icon.data-v-2f35fb20 {
|
|
||||||
width: 90rpx;
|
|
||||||
height: 90rpx;
|
|
||||||
margin-right: 20rpx;
|
|
||||||
z-index: 2;
|
|
||||||
}
|
|
||||||
.nav-button-content.data-v-2f35fb20 {
|
|
||||||
z-index: 2;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
.nav-button-title.data-v-2f35fb20 {
|
|
||||||
font-size: 34rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-bottom: 8rpx;
|
|
||||||
}
|
|
||||||
.nav-button-desc.data-v-2f35fb20 {
|
|
||||||
font-size: 24rpx;
|
|
||||||
opacity: 0.85;
|
|
||||||
}
|
}
|
||||||
@@ -1,116 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../../../common/vendor.js");
|
|
||||||
const uni_modules_nutuiUni_components__constants_prefix = require("../_constants/prefix.js");
|
|
||||||
const uni_modules_nutuiUni_components__hooks_useProvide = require("../_hooks/useProvide.js");
|
|
||||||
const uni_modules_nutuiUni_components__hooks_useRect = require("../_hooks/useRect.js");
|
|
||||||
const uni_modules_nutuiUni_components__utils_common = require("../_utils/common.js");
|
|
||||||
require("../_utils/env.js");
|
|
||||||
const uni_modules_nutuiUni_components__utils_style = require("../_utils/style.js");
|
|
||||||
const menu = require("../../../../menu.js");
|
|
||||||
const Icon = () => "../icon/icon.js";
|
|
||||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-menu`;
|
|
||||||
const _sfc_main = common_vendor.defineComponent({
|
|
||||||
name: componentName,
|
|
||||||
components: { Icon },
|
|
||||||
props: menu.menuProps,
|
|
||||||
options: {
|
|
||||||
virtualHost: true,
|
|
||||||
addGlobalClass: true,
|
|
||||||
styleIsolation: "shared"
|
|
||||||
},
|
|
||||||
setup(props) {
|
|
||||||
const barId = `nut-menu__bar${uni_modules_nutuiUni_components__utils_common.getRandomId()}`;
|
|
||||||
const offset = common_vendor.ref(0);
|
|
||||||
const instance = common_vendor.getCurrentInstance();
|
|
||||||
const { children } = uni_modules_nutuiUni_components__hooks_useProvide.useProvide(menu.MENU_KEY)({ props, offset });
|
|
||||||
const opened = common_vendor.computed(() => children.some((item) => {
|
|
||||||
var _a;
|
|
||||||
return (_a = item == null ? void 0 : item.state) == null ? void 0 : _a.showWrapper;
|
|
||||||
}));
|
|
||||||
const isScrollFixed = common_vendor.computed(() => {
|
|
||||||
const { scrollFixed, scrollTop } = props;
|
|
||||||
if (!scrollFixed)
|
|
||||||
return false;
|
|
||||||
return scrollTop > (typeof scrollFixed === "boolean" ? 30 : Number(scrollFixed));
|
|
||||||
});
|
|
||||||
const classes = common_vendor.computed(() => {
|
|
||||||
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName, {
|
|
||||||
"scroll-fixed": isScrollFixed.value
|
|
||||||
});
|
|
||||||
});
|
|
||||||
function updateOffset(children2) {
|
|
||||||
setTimeout(() => {
|
|
||||||
uni_modules_nutuiUni_components__hooks_useRect.useRect(barId, instance).then((rect) => {
|
|
||||||
if (props.direction === "down")
|
|
||||||
offset.value = rect.bottom + common_vendor.index.getSystemInfoSync().windowTop;
|
|
||||||
else
|
|
||||||
offset.value = common_vendor.index.getSystemInfoSync().windowHeight - rect.top;
|
|
||||||
children2.toggle();
|
|
||||||
});
|
|
||||||
}, 100);
|
|
||||||
}
|
|
||||||
function toggleItem(active) {
|
|
||||||
children.forEach((item, index) => {
|
|
||||||
if (index === active)
|
|
||||||
updateOffset(item);
|
|
||||||
else if (item.state.showPopup)
|
|
||||||
item.toggle(false, { immediate: true });
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function getClasses(showPopup) {
|
|
||||||
let str = "";
|
|
||||||
const { titleClass } = props;
|
|
||||||
if (showPopup)
|
|
||||||
str += "active";
|
|
||||||
if (titleClass)
|
|
||||||
str += ` ${titleClass}`;
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
barId,
|
|
||||||
toggleItem,
|
|
||||||
children,
|
|
||||||
opened,
|
|
||||||
classes,
|
|
||||||
getClasses
|
|
||||||
};
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (!Array) {
|
|
||||||
const _component_Icon = common_vendor.resolveComponent("Icon");
|
|
||||||
_component_Icon();
|
|
||||||
}
|
|
||||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
||||||
return {
|
|
||||||
a: common_vendor.f(_ctx.children, (item, index, i0) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: common_vendor.t(item.renderTitle())
|
|
||||||
}, _ctx.direction === "up" ? {
|
|
||||||
b: "0481e128-0-" + i0,
|
|
||||||
c: common_vendor.p({
|
|
||||||
name: _ctx.upIcon
|
|
||||||
})
|
|
||||||
} : {
|
|
||||||
d: "0481e128-1-" + i0,
|
|
||||||
e: common_vendor.p({
|
|
||||||
name: _ctx.downIcon
|
|
||||||
})
|
|
||||||
}, {
|
|
||||||
f: common_vendor.n(_ctx.getClasses(item.state.showPopup)),
|
|
||||||
g: item.disabled ? 1 : "",
|
|
||||||
h: item.state.showPopup ? 1 : "",
|
|
||||||
i: item.state.showPopup ? _ctx.activeColor : "",
|
|
||||||
j: common_vendor.o(($event) => !item.disabled && _ctx.toggleItem(index), index),
|
|
||||||
k: index
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
b: _ctx.direction === "up",
|
|
||||||
c: _ctx.barId,
|
|
||||||
d: _ctx.opened ? 1 : "",
|
|
||||||
e: common_vendor.n(_ctx.classes),
|
|
||||||
f: common_vendor.s(_ctx.customStyle)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
||||||
wx.createComponent(Component);
|
|
||||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/menu/menu.js.map
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"component": true,
|
|
||||||
"usingComponents": {
|
|
||||||
"icon": "../icon/icon"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<view class="{{e}}" style="{{f}}"><view id="{{c}}" class="{{['nut-menu__bar', d && 'opened']}}"><block wx:for="{{a}}" wx:for-item="item" wx:key="k"><view class="{{['nut-menu__item', item.g && 'disabled', item.h && 'active']}}" style="{{'color:' + item.i}}" bindtap="{{item.j}}"><view class="{{['nut-menu__title', item.f]}}"><view class="nut-menu__title-text">{{item.a}}</view><view class="nut-menu__title-icon"><icon wx:if="{{b}}" u-i="{{item.b}}" bind:__l="__l" u-p="{{item.c}}"/><icon wx:else u-i="{{item.d}}" bind:__l="__l" u-p="{{item.e||''}}"/></view></view></view></block></view><slot/></view>
|
|
||||||
@@ -1,106 +0,0 @@
|
|||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
.nut-theme-dark .nut-menu .nut-menu__bar {
|
|
||||||
background-color: var(--nut-dark-background, #131313);
|
|
||||||
}
|
|
||||||
.nut-theme-dark .nut-menu .nut-menu__bar .nut-menu__item {
|
|
||||||
color: var(--nut-dark-color, var(--nut-white, #fff));
|
|
||||||
}
|
|
||||||
.nut-menu.scroll-fixed {
|
|
||||||
position: fixed;
|
|
||||||
top: var(--nut-menu-scroll-fixed-top, 0);
|
|
||||||
z-index: var(--nut-menu-scroll-fixed-z-index, 1000);
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.nut-menu .nut-menu__bar {
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
|
||||||
line-height: var(--nut-menu-bar-line-height, 48px);
|
|
||||||
background-color: var(--nut-white, #fff);
|
|
||||||
box-shadow: var(--nut-menu-bar-box-shadow, 0 2px 12px rgba(89, 89, 89, 0.12));
|
|
||||||
}
|
|
||||||
.nut-menu .nut-menu__bar.opened {
|
|
||||||
z-index: var(--nut-menu-bar-opened-z-index, 2001);
|
|
||||||
}
|
|
||||||
.nut-menu .nut-menu__bar .nut-menu__item {
|
|
||||||
flex: 1;
|
|
||||||
min-width: 0;
|
|
||||||
font-size: var(--nut-menu-item-font-size, var(--nut-font-size-2, 14px));
|
|
||||||
color: var(--nut-menu-item-text-color, var(--nut-title-color, #1a1a1a));
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.nut-menu .nut-menu__bar .nut-menu__item.active {
|
|
||||||
color: var(--nut-menu-item-active-text-color, var(--nut-primary-color, #fa2c19));
|
|
||||||
}
|
|
||||||
.nut-menu .nut-menu__bar .nut-menu__item.disabled {
|
|
||||||
color: var(--nut-menu-item-disabled-color, #969799);
|
|
||||||
}
|
|
||||||
.nut-menu .nut-menu__bar .nut-menu__item .nut-menu__title-icon {
|
|
||||||
display: flex;
|
|
||||||
transition: all 0.2s linear;
|
|
||||||
}
|
|
||||||
.nut-menu .nut-menu__bar .nut-menu__item .nut-menu__title {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
.nut-menu .nut-menu__bar .nut-menu__item .nut-menu__title .nut-menu__title-text {
|
|
||||||
display: block;
|
|
||||||
padding-right: var(--nut-menu-title-text-padding-right, 8px);
|
|
||||||
padding-left: var(--nut-menu-title-text-padding-left, 8px);
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
.nut-menu .nut-menu__bar .nut-menu__item .nut-menu__title.active .nut-menu__title-icon {
|
|
||||||
transform: rotate(180deg);
|
|
||||||
}
|
|
||||||
@@ -1,220 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../../../common/vendor.js");
|
|
||||||
const uni_modules_nutuiUni_components__constants_event = require("../_constants/event.js");
|
|
||||||
const uni_modules_nutuiUni_components__constants_prefix = require("../_constants/prefix.js");
|
|
||||||
const uni_modules_nutuiUni_components__hooks_useInject = require("../_hooks/useInject.js");
|
|
||||||
require("../_utils/env.js");
|
|
||||||
const uni_modules_nutuiUni_components__utils_style = require("../_utils/style.js");
|
|
||||||
const menu = require("../../../../menu.js");
|
|
||||||
const uni_modules_nutuiUni_components__utils_props = require("../_utils/props.js");
|
|
||||||
const menuitemProps = {
|
|
||||||
...uni_modules_nutuiUni_components__utils_props.commonProps,
|
|
||||||
/**
|
|
||||||
* @@description 菜单项标题
|
|
||||||
*/
|
|
||||||
title: String,
|
|
||||||
/**
|
|
||||||
* @description 选项数组
|
|
||||||
*/
|
|
||||||
options: uni_modules_nutuiUni_components__utils_props.makeArrayProp([]),
|
|
||||||
/**
|
|
||||||
* @description 是否禁用菜单
|
|
||||||
*/
|
|
||||||
disabled: Boolean,
|
|
||||||
modelValue: [String, Number],
|
|
||||||
/**
|
|
||||||
* @description 可以设置一行展示多少列 `options`
|
|
||||||
*/
|
|
||||||
cols: uni_modules_nutuiUni_components__utils_props.makeNumberProp(1),
|
|
||||||
/**
|
|
||||||
* @description 选项选中时自定义标题样式类
|
|
||||||
*/
|
|
||||||
activeTitleClass: String,
|
|
||||||
/**
|
|
||||||
* @description 选项非选中时自定义标题样式类
|
|
||||||
*/
|
|
||||||
inactiveTitleClass: String,
|
|
||||||
/**
|
|
||||||
* @description 选项选中时选中图标
|
|
||||||
*/
|
|
||||||
optionIcon: uni_modules_nutuiUni_components__utils_props.makeStringProp("Check")
|
|
||||||
};
|
|
||||||
const menuitemEmits = {
|
|
||||||
[uni_modules_nutuiUni_components__constants_event.UPDATE_MODEL_EVENT]: (value) => true,
|
|
||||||
[uni_modules_nutuiUni_components__constants_event.CHANGE_EVENT]: (value) => true,
|
|
||||||
[uni_modules_nutuiUni_components__constants_event.OPEN_EVENT]: () => true,
|
|
||||||
[uni_modules_nutuiUni_components__constants_event.CLOSE_EVENT]: () => true,
|
|
||||||
itemClick: (item) => true
|
|
||||||
};
|
|
||||||
const Icon = () => "../icon/icon.js";
|
|
||||||
const PopUp = () => "../popup/popup.js";
|
|
||||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-menu-item`;
|
|
||||||
const _sfc_main = common_vendor.defineComponent({
|
|
||||||
name: componentName,
|
|
||||||
options: {
|
|
||||||
virtualHost: true,
|
|
||||||
addGlobalClass: true,
|
|
||||||
styleIsolation: "shared"
|
|
||||||
},
|
|
||||||
components: {
|
|
||||||
PopUp,
|
|
||||||
Icon
|
|
||||||
},
|
|
||||||
props: menuitemProps,
|
|
||||||
emits: menuitemEmits,
|
|
||||||
setup(props, { emit, expose }) {
|
|
||||||
const state = common_vendor.reactive({
|
|
||||||
showPopup: false,
|
|
||||||
showWrapper: false
|
|
||||||
});
|
|
||||||
const { parent } = uni_modules_nutuiUni_components__hooks_useInject.useInject(menu.MENU_KEY);
|
|
||||||
const classes = common_vendor.computed(() => {
|
|
||||||
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName, {
|
|
||||||
"nut-hidden": !state.showWrapper
|
|
||||||
});
|
|
||||||
});
|
|
||||||
const styles = common_vendor.computed(() => {
|
|
||||||
if ((parent == null ? void 0 : parent.props.offset) > 0) {
|
|
||||||
const obj = (parent == null ? void 0 : parent.props.direction) === "down" ? { top: `${parent == null ? void 0 : parent.props.offset}px` } : { bottom: `${parent == null ? void 0 : parent.offset.value}px` };
|
|
||||||
return uni_modules_nutuiUni_components__utils_style.getMainStyle(props, obj);
|
|
||||||
} else {
|
|
||||||
const obj = (parent == null ? void 0 : parent.props.direction) === "down" ? { top: `${parent == null ? void 0 : parent.offset.value}px` } : { bottom: `${parent == null ? void 0 : parent.offset.value}px` };
|
|
||||||
return uni_modules_nutuiUni_components__utils_style.getMainStyle(props, obj);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
const placeholderElementStyle = common_vendor.computed(() => {
|
|
||||||
const heightStyle = { height: `${parent == null ? void 0 : parent.offset.value}px` };
|
|
||||||
if ((parent == null ? void 0 : parent.props.direction) === "down")
|
|
||||||
return { ...heightStyle, top: 0 };
|
|
||||||
return { ...heightStyle, top: "auto" };
|
|
||||||
});
|
|
||||||
const open = () => {
|
|
||||||
state.showPopup = true;
|
|
||||||
state.showWrapper = true;
|
|
||||||
};
|
|
||||||
const close = () => {
|
|
||||||
state.showPopup = false;
|
|
||||||
};
|
|
||||||
const toggle = (show = !state.showPopup) => {
|
|
||||||
if (show === state.showPopup)
|
|
||||||
return;
|
|
||||||
if (show)
|
|
||||||
open();
|
|
||||||
else
|
|
||||||
close();
|
|
||||||
};
|
|
||||||
const change = (value) => {
|
|
||||||
if (value === props.modelValue)
|
|
||||||
return;
|
|
||||||
emit("update:modelValue", value);
|
|
||||||
emit("change", value);
|
|
||||||
};
|
|
||||||
const renderTitle = () => {
|
|
||||||
var _a;
|
|
||||||
if (props.title)
|
|
||||||
return props.title;
|
|
||||||
const match = (_a = props.options) == null ? void 0 : _a.find((option) => option.value === props.modelValue);
|
|
||||||
return match ? match.text : "";
|
|
||||||
};
|
|
||||||
const onClick = (option) => {
|
|
||||||
state.showPopup = false;
|
|
||||||
emit("itemClick", option);
|
|
||||||
change(option.value);
|
|
||||||
};
|
|
||||||
const handleClose = () => {
|
|
||||||
state.showWrapper = false;
|
|
||||||
};
|
|
||||||
const handleClickOutside = () => {
|
|
||||||
state.showPopup = false;
|
|
||||||
};
|
|
||||||
const handleVisible = (visible) => {
|
|
||||||
if (visible)
|
|
||||||
emit(uni_modules_nutuiUni_components__constants_event.OPEN_EVENT);
|
|
||||||
else
|
|
||||||
emit(uni_modules_nutuiUni_components__constants_event.CLOSE_EVENT);
|
|
||||||
};
|
|
||||||
expose({
|
|
||||||
change,
|
|
||||||
open,
|
|
||||||
close,
|
|
||||||
toggle
|
|
||||||
});
|
|
||||||
return {
|
|
||||||
classes,
|
|
||||||
styles,
|
|
||||||
placeholderElementStyle,
|
|
||||||
renderTitle,
|
|
||||||
state,
|
|
||||||
parent,
|
|
||||||
toggle,
|
|
||||||
onClick,
|
|
||||||
handleClose,
|
|
||||||
handleVisible,
|
|
||||||
handleClickOutside
|
|
||||||
};
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (!Array) {
|
|
||||||
const _component_Icon = common_vendor.resolveComponent("Icon");
|
|
||||||
const _component_PopUp = common_vendor.resolveComponent("PopUp");
|
|
||||||
(_component_Icon + _component_PopUp)();
|
|
||||||
}
|
|
||||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
||||||
var _a, _b, _c, _d, _e, _f;
|
|
||||||
return {
|
|
||||||
a: !_ctx.state.showPopup ? 1 : "",
|
|
||||||
b: ((_a = _ctx.parent) == null ? void 0 : _a.props.direction) === "up" ? 1 : "",
|
|
||||||
c: common_vendor.s(_ctx.placeholderElementStyle),
|
|
||||||
d: common_vendor.o((...args) => _ctx.handleClickOutside && _ctx.handleClickOutside(...args)),
|
|
||||||
e: common_vendor.f(_ctx.options, (option, index, i0) => {
|
|
||||||
var _a2, _b2;
|
|
||||||
return common_vendor.e({
|
|
||||||
a: option.value === _ctx.modelValue
|
|
||||||
}, option.value === _ctx.modelValue ? {
|
|
||||||
b: "79751d88-1-" + i0 + ",79751d88-0",
|
|
||||||
c: common_vendor.p({
|
|
||||||
name: _ctx.optionIcon,
|
|
||||||
["custom-color"]: (_a2 = _ctx.parent) == null ? void 0 : _a2.props.activeColor
|
|
||||||
}),
|
|
||||||
d: common_vendor.n(option.value === _ctx.modelValue ? _ctx.activeTitleClass : _ctx.inactiveTitleClass)
|
|
||||||
} : {}, {
|
|
||||||
e: common_vendor.t(option.text),
|
|
||||||
f: common_vendor.n(option.value === _ctx.modelValue ? _ctx.activeTitleClass : _ctx.inactiveTitleClass),
|
|
||||||
g: option.value === _ctx.modelValue ? (_b2 = _ctx.parent) == null ? void 0 : _b2.props.activeColor : "",
|
|
||||||
h: index,
|
|
||||||
i: common_vendor.n({
|
|
||||||
active: option.value === _ctx.modelValue
|
|
||||||
}),
|
|
||||||
j: common_vendor.o(($event) => _ctx.onClick(option), index)
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
f: `${100 / _ctx.cols}%`,
|
|
||||||
g: common_vendor.o(_ctx.handleClose),
|
|
||||||
h: common_vendor.o(($event) => _ctx.handleVisible(true)),
|
|
||||||
i: common_vendor.o(($event) => _ctx.handleVisible(false)),
|
|
||||||
j: common_vendor.o(($event) => _ctx.state.showPopup = $event),
|
|
||||||
k: common_vendor.p({
|
|
||||||
..._ctx.$attrs,
|
|
||||||
["custom-style"]: {
|
|
||||||
position: "absolute"
|
|
||||||
},
|
|
||||||
["overlay-style"]: {
|
|
||||||
position: "absolute"
|
|
||||||
},
|
|
||||||
position: ((_b = _ctx.parent) == null ? void 0 : _b.props.direction) === "down" ? "top" : "bottom",
|
|
||||||
duration: (_c = _ctx.parent) == null ? void 0 : _c.props.duration,
|
|
||||||
["pop-class"]: "nut-menu__pop",
|
|
||||||
["destroy-on-close"]: false,
|
|
||||||
["safe-area-inset-top"]: false,
|
|
||||||
overlay: (_d = _ctx.parent) == null ? void 0 : _d.props.overlay,
|
|
||||||
["lock-scroll"]: (_e = _ctx.parent) == null ? void 0 : _e.props.lockScroll,
|
|
||||||
["close-on-click-overlay"]: (_f = _ctx.parent) == null ? void 0 : _f.props.closeOnClickOverlay,
|
|
||||||
visible: _ctx.state.showPopup
|
|
||||||
}),
|
|
||||||
l: common_vendor.n(_ctx.classes),
|
|
||||||
m: common_vendor.s(_ctx.styles)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
||||||
wx.createComponent(Component);
|
|
||||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/menuitem/menuitem.js.map
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"component": true,
|
|
||||||
"usingComponents": {
|
|
||||||
"icon": "../icon/icon",
|
|
||||||
"pop-up": "../popup/popup"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<view class="{{l}}" style="{{m}}"><view class="{{['nut-menu-item-placeholder-element', a && 'nut-hidden', b && 'placeholder-element-up']}}" style="{{c}}" bindtap="{{d}}"/><pop-up wx:if="{{k}}" u-s="{{['d']}}" bindclosed="{{g}}" bindopen="{{h}}" bindclose="{{i}}" u-i="79751d88-0" bind:__l="__l" bindupdateVisible="{{j}}" u-p="{{k}}"><scroll-view scroll-y="{{true}}"><view id="nut-menu-item__content" class="nut-menu-item__content"><view wx:for="{{e}}" wx:for-item="option" wx:key="h" class="{{['nut-menu-item__option', option.i]}}" style="{{'flex-basis:' + f}}" bindtap="{{option.j}}"><view wx:if="{{option.a}}" class="{{['nut-menu-item__span', option.d]}}"><icon wx:if="{{option.c}}" u-i="{{option.b}}" bind:__l="__l" u-p="{{option.c}}"/></view><view class="{{[option.f]}}" style="{{'color:' + option.g}}">{{option.e}}</view></view><slot/></view></scroll-view></pop-up></view>
|
|
||||||
@@ -1,216 +0,0 @@
|
|||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
.nut-overlay {
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
background: var(--nut-overlay-bg-color, rgba(0, 0, 0, 0.7));
|
|
||||||
}
|
|
||||||
.nut-overflow-hidden {
|
|
||||||
overflow: hidden !important;
|
|
||||||
}
|
|
||||||
.nut-theme-dark .nut-popup {
|
|
||||||
background: var(--nut-dark-background2, #1b1b1b);
|
|
||||||
}
|
|
||||||
.nut-theme-dark .nut-popup__close-icon {
|
|
||||||
color: var(--nut-dark-color, var(--nut-white, #fff));
|
|
||||||
}
|
|
||||||
.nut-popup-slide-center-enter-active, .nut-popup-slide-center-leave-active {
|
|
||||||
transition-timing-function: ease;
|
|
||||||
transition-property: opacity;
|
|
||||||
}
|
|
||||||
.nut-popup-slide-center-enter-from, .nut-popup-slide-center-leave-to {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
.nut-popup-slide-top-enter-from, .nut-popup-slide-top-leave-active {
|
|
||||||
transform: translate(0, -100%);
|
|
||||||
}
|
|
||||||
.nut-popup-slide-right-enter-from, .nut-popup-slide-right-leave-active {
|
|
||||||
transform: translate(100%, 0);
|
|
||||||
}
|
|
||||||
.nut-popup-slide-bottom-enter-from, .nut-popup-slide-bottom-leave-active {
|
|
||||||
transform: translate(0, 100%);
|
|
||||||
}
|
|
||||||
.nut-popup-slide-left-enter-from, .nut-popup-slide-left-leave-active {
|
|
||||||
transform: translate(-100%, 0);
|
|
||||||
}
|
|
||||||
.nut-popup--center {
|
|
||||||
top: 50%;
|
|
||||||
left: 50%;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
}
|
|
||||||
.nut-popup--center.round {
|
|
||||||
border-radius: var(--nut-popup-border-radius, 20px);
|
|
||||||
}
|
|
||||||
.nut-popup--bottom {
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.nut-popup--bottom.round {
|
|
||||||
border-radius: var(--nut-popup-border-radius, 20px) var(--nut-popup-border-radius, 20px) 0 0;
|
|
||||||
}
|
|
||||||
.nut-popup--bottom--safebottom {
|
|
||||||
padding-bottom: constant(safe-area-inset-bottom);
|
|
||||||
padding-bottom: env(safe-area-inset-bottom);
|
|
||||||
}
|
|
||||||
.nut-popup--right {
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
.nut-popup--right.round {
|
|
||||||
border-radius: var(--nut-popup-border-radius, 20px) 0 0 var(--nut-popup-border-radius, 20px);
|
|
||||||
}
|
|
||||||
.nut-popup--left {
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
}
|
|
||||||
.nut-popup--left.round {
|
|
||||||
border-radius: 0 var(--nut-popup-border-radius, 20px) var(--nut-popup-border-radius, 20px) 0;
|
|
||||||
}
|
|
||||||
.nut-popup--top {
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.nut-popup--top.round {
|
|
||||||
border-radius: 0 0 var(--nut-popup-border-radius, 20px) var(--nut-popup-border-radius, 20px);
|
|
||||||
}
|
|
||||||
.nut-popup--top--safetop {
|
|
||||||
padding-top: var(--status-bar-height);
|
|
||||||
padding-top: constant(safe-area-inset-top);
|
|
||||||
padding-top: env(safe-area-inset-top);
|
|
||||||
}
|
|
||||||
.nut-popup {
|
|
||||||
position: fixed;
|
|
||||||
max-height: 100%;
|
|
||||||
overflow-y: auto;
|
|
||||||
background-color: var(--nut-white, #fff);
|
|
||||||
-webkit-overflow-scrolling: touch;
|
|
||||||
}
|
|
||||||
.nut-popup__close-icon {
|
|
||||||
position: absolute !important;
|
|
||||||
z-index: 1;
|
|
||||||
width: 30px;
|
|
||||||
height: 30px;
|
|
||||||
font-size: 18px;
|
|
||||||
line-height: 30px;
|
|
||||||
color: #969799;
|
|
||||||
text-align: center;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.nut-popup__close-icon:active {
|
|
||||||
opacity: 0.7;
|
|
||||||
}
|
|
||||||
.nut-popup__close-icon--top-left {
|
|
||||||
top: var(--nut-popup-close-icon-margin, 16px);
|
|
||||||
left: var(--nut-popup-close-icon-margin, 16px);
|
|
||||||
}
|
|
||||||
.nut-popup__close-icon--top-right {
|
|
||||||
top: var(--nut-popup-close-icon-margin, 16px);
|
|
||||||
right: var(--nut-popup-close-icon-margin, 16px);
|
|
||||||
}
|
|
||||||
.nut-popup__close-icon--bottom-left {
|
|
||||||
bottom: var(--nut-popup-close-icon-margin, 16px);
|
|
||||||
left: var(--nut-popup-close-icon-margin, 16px);
|
|
||||||
}
|
|
||||||
.nut-popup__close-icon--bottom-right {
|
|
||||||
right: var(--nut-popup-close-icon-margin, 16px);
|
|
||||||
bottom: var(--nut-popup-close-icon-margin, 16px);
|
|
||||||
}
|
|
||||||
.nut-theme-dark .nut-menu-item__content .nut-menu-item__option {
|
|
||||||
color: var(--nut-dark-color, var(--nut-white, #fff));
|
|
||||||
}
|
|
||||||
.nut-menu-item {
|
|
||||||
position: fixed;
|
|
||||||
right: 0;
|
|
||||||
left: 0;
|
|
||||||
z-index: var(--nut-menu-bar-opened-z-index, 2001);
|
|
||||||
height: 100vh;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.nut-menu-item .active {
|
|
||||||
font-weight: var(--nut-menu-active-item-font-weight, 500);
|
|
||||||
color: var(--nut-menu-item-active-text-color, var(--nut-primary-color, #fa2c19)) !important;
|
|
||||||
}
|
|
||||||
.nut-menu-item__content {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
max-height: var(--nut-menu-item-content-max-height, 214px);
|
|
||||||
padding: var(--nut-menu-item-content-padding, 12px 24px);
|
|
||||||
}
|
|
||||||
.nut-menu-item__content.nut-menu-item__overflow {
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
.nut-menu-item__content .nut-menu-item__option {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
padding-top: var(--nut-menu-item-option-padding-top, 12px);
|
|
||||||
padding-bottom: var(--nut-menu-item-option-padding-bottom, 12px);
|
|
||||||
padding-left: 12px;
|
|
||||||
padding-right: 12px;
|
|
||||||
font-size: var(--nut-font-size-2, 14px);
|
|
||||||
color: var(--nut-title-color, #1a1a1a);
|
|
||||||
}
|
|
||||||
.nut-menu-item__content .nut-menu-item__option .nut-menu-item__span {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
margin-right: var(--nut-menu-item-option-i-margin-right, 6px);
|
|
||||||
}
|
|
||||||
.nut-menu-item-placeholder-element {
|
|
||||||
position: fixed;
|
|
||||||
right: 0;
|
|
||||||
left: 0;
|
|
||||||
z-index: var(--nut-menu-bar-opened-z-index, 2001);
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
@@ -1,353 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../../../common/vendor.js");
|
|
||||||
const uni_modules_nutuiUni_components__constants_event = require("../_constants/event.js");
|
|
||||||
const uni_modules_nutuiUni_components__constants_prefix = require("../_constants/prefix.js");
|
|
||||||
const uni_modules_nutuiUni_components__hooks_useSelectorQuery = require("../_hooks/useSelectorQuery.js");
|
|
||||||
const uni_modules_nutuiUni_components__utils_is = require("../_utils/is.js");
|
|
||||||
require("../_utils/env.js");
|
|
||||||
const uni_modules_nutuiUni_components__utils_pxCheck = require("../_utils/pxCheck.js");
|
|
||||||
const uni_modules_nutuiUni_components__utils_style = require("../_utils/style.js");
|
|
||||||
const uni_modules_nutuiUni_components__utils_props = require("../_utils/props.js");
|
|
||||||
const noticebarProps = {
|
|
||||||
...uni_modules_nutuiUni_components__utils_props.commonProps,
|
|
||||||
/**
|
|
||||||
* @description 滚动的方向,可选 `across`、`vertical`
|
|
||||||
*/
|
|
||||||
direction: uni_modules_nutuiUni_components__utils_props.makeStringProp("across"),
|
|
||||||
/**
|
|
||||||
* @description 纵向滚动数据列表, `vertical`方向
|
|
||||||
*/
|
|
||||||
list: uni_modules_nutuiUni_components__utils_props.makeArrayProp([]),
|
|
||||||
/**
|
|
||||||
* @description 停留时间(毫秒),`vertical`方向
|
|
||||||
*/
|
|
||||||
standTime: uni_modules_nutuiUni_components__utils_props.makeNumberProp(1e3),
|
|
||||||
/**
|
|
||||||
* @description 稍复杂的动画,耗能会高,`vertical`方向
|
|
||||||
*/
|
|
||||||
complexAm: Boolean,
|
|
||||||
/**
|
|
||||||
* @description 每一个滚动列的高度(px),注意:在使用 slot 插槽定义滚动单元时,按照实际高度修改此值
|
|
||||||
*/
|
|
||||||
height: uni_modules_nutuiUni_components__utils_props.makeNumberProp(40),
|
|
||||||
/**
|
|
||||||
* @description 提示的信息
|
|
||||||
*/
|
|
||||||
text: uni_modules_nutuiUni_components__utils_props.makeStringProp(""),
|
|
||||||
/**
|
|
||||||
* @description 是否启用关闭模式
|
|
||||||
*/
|
|
||||||
closeMode: Boolean,
|
|
||||||
/**
|
|
||||||
* @description 是否展示左侧图标, 滚动方向为 `across` 生效
|
|
||||||
*/
|
|
||||||
leftIcon: uni_modules_nutuiUni_components__utils_props.truthProp,
|
|
||||||
/**
|
|
||||||
* @description 导航栏的文字颜色
|
|
||||||
*/
|
|
||||||
customColor: uni_modules_nutuiUni_components__utils_props.makeStringProp(""),
|
|
||||||
/**
|
|
||||||
* @description 导航栏的背景颜色
|
|
||||||
*/
|
|
||||||
background: uni_modules_nutuiUni_components__utils_props.makeStringProp(""),
|
|
||||||
/**
|
|
||||||
* @description 延时多少秒
|
|
||||||
*/
|
|
||||||
delay: uni_modules_nutuiUni_components__utils_props.makeNumericProp(1),
|
|
||||||
/**
|
|
||||||
* @description 是否可以滚动
|
|
||||||
*/
|
|
||||||
scrollable: uni_modules_nutuiUni_components__utils_props.truthProp,
|
|
||||||
/**
|
|
||||||
* @description 滚动速率 (px/s)
|
|
||||||
*/
|
|
||||||
speed: uni_modules_nutuiUni_components__utils_props.makeNumberProp(50),
|
|
||||||
/**
|
|
||||||
* @description 是否开启文本换行,`scrollable` 会设置为 `false`
|
|
||||||
*/
|
|
||||||
wrapable: Boolean,
|
|
||||||
/**
|
|
||||||
* @description `vertical`方向时`list`属性如果传入数组对象,显示文本的字段名
|
|
||||||
*/
|
|
||||||
fieldName: String
|
|
||||||
};
|
|
||||||
const noticebarEmits = {
|
|
||||||
[uni_modules_nutuiUni_components__constants_event.CLICK_EVENT]: (value) => value instanceof Object || uni_modules_nutuiUni_components__utils_is.isString(value),
|
|
||||||
[uni_modules_nutuiUni_components__constants_event.CLOSE_EVENT]: (evt) => evt instanceof Object || uni_modules_nutuiUni_components__utils_is.isString(evt),
|
|
||||||
acrossEnd: (evt) => evt instanceof Object
|
|
||||||
};
|
|
||||||
if (!Math) {
|
|
||||||
NutIcon();
|
|
||||||
}
|
|
||||||
const NutIcon = () => "../icon/icon.js";
|
|
||||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-noticebar`;
|
|
||||||
const __default__ = common_vendor.defineComponent({
|
|
||||||
name: componentName,
|
|
||||||
options: {
|
|
||||||
virtualHost: true,
|
|
||||||
addGlobalClass: true,
|
|
||||||
styleIsolation: "shared"
|
|
||||||
}
|
|
||||||
});
|
|
||||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
||||||
...__default__,
|
|
||||||
props: noticebarProps,
|
|
||||||
emits: noticebarEmits,
|
|
||||||
setup(__props, { emit: __emit }) {
|
|
||||||
const props = __props;
|
|
||||||
const emit = __emit;
|
|
||||||
const instance = common_vendor.getCurrentInstance();
|
|
||||||
const { getSelectorNodeInfo } = uni_modules_nutuiUni_components__hooks_useSelectorQuery.useSelectorQuery(instance);
|
|
||||||
common_vendor.ref(null);
|
|
||||||
common_vendor.ref(null);
|
|
||||||
const state = common_vendor.reactive({
|
|
||||||
wrapWidth: 0,
|
|
||||||
firstRound: true,
|
|
||||||
duration: 0,
|
|
||||||
offsetWidth: 0,
|
|
||||||
showNoticebar: true,
|
|
||||||
animationClass: "",
|
|
||||||
animate: false,
|
|
||||||
scrollList: [],
|
|
||||||
distance: 0,
|
|
||||||
timer: null,
|
|
||||||
keepAlive: false,
|
|
||||||
isCanScroll: null,
|
|
||||||
showNotica: true,
|
|
||||||
id: Math.round(Math.random() * 1e5)
|
|
||||||
});
|
|
||||||
const classes = common_vendor.computed(() => {
|
|
||||||
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName);
|
|
||||||
});
|
|
||||||
const isEllipsis = common_vendor.computed(() => {
|
|
||||||
if (state.isCanScroll == null)
|
|
||||||
return false;
|
|
||||||
else
|
|
||||||
return !state.isCanScroll && !props.wrapable;
|
|
||||||
});
|
|
||||||
const wrapContentClass = common_vendor.computed(() => {
|
|
||||||
return {
|
|
||||||
"nut-noticebar__page-wrap-content": true,
|
|
||||||
"nut-ellipsis": isEllipsis.value,
|
|
||||||
[`content${state.id}`]: true,
|
|
||||||
[state.animationClass]: true
|
|
||||||
};
|
|
||||||
});
|
|
||||||
const barStyle = common_vendor.computed(() => {
|
|
||||||
const style = {};
|
|
||||||
props.customColor && (style.color = props.customColor);
|
|
||||||
props.background && (style.background = props.background);
|
|
||||||
if (props.direction === "vertical")
|
|
||||||
style.height = `${props.height}px`;
|
|
||||||
return style;
|
|
||||||
});
|
|
||||||
const contentStyle = common_vendor.computed(() => {
|
|
||||||
return {
|
|
||||||
animationDelay: `${state.firstRound ? props.delay : 0}s`,
|
|
||||||
animationDuration: `${state.duration}s`,
|
|
||||||
transform: `translateX(${state.firstRound ? 0 : `${state.wrapWidth}px`})`
|
|
||||||
};
|
|
||||||
});
|
|
||||||
const horseLampStyle = common_vendor.computed(() => {
|
|
||||||
let styles = {};
|
|
||||||
if (props.complexAm) {
|
|
||||||
styles = {
|
|
||||||
transform: `translateY(${state.distance}px)`
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
if (state.animate) {
|
|
||||||
styles = {
|
|
||||||
"transition": `all ${~~(props.height / props.speed / 4)}s`,
|
|
||||||
"margin-top": `-${props.height}px`
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return styles;
|
|
||||||
});
|
|
||||||
common_vendor.watch(
|
|
||||||
() => props.text,
|
|
||||||
() => {
|
|
||||||
initScrollWrap();
|
|
||||||
}
|
|
||||||
);
|
|
||||||
common_vendor.watch(
|
|
||||||
() => props.list,
|
|
||||||
(value) => {
|
|
||||||
state.scrollList = [].concat(value);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
function initScrollWrap() {
|
|
||||||
if (state.showNoticebar === false)
|
|
||||||
return;
|
|
||||||
setTimeout(() => {
|
|
||||||
if (state.showNoticebar === false)
|
|
||||||
return;
|
|
||||||
let wrapWidth = 0;
|
|
||||||
let offsetWidth = 0;
|
|
||||||
getSelectorNodeInfo(`.wrap${state.id}`).then((rect) => {
|
|
||||||
if (rect.width > 0)
|
|
||||||
wrapWidth = rect.width;
|
|
||||||
getSelectorNodeInfo(`.content${state.id}`).then((rect2) => {
|
|
||||||
if (rect2.width > 0)
|
|
||||||
offsetWidth = rect2.width;
|
|
||||||
state.isCanScroll = props.scrollable == null ? offsetWidth > wrapWidth : props.scrollable;
|
|
||||||
if (state.isCanScroll) {
|
|
||||||
state.wrapWidth = wrapWidth;
|
|
||||||
state.offsetWidth = offsetWidth;
|
|
||||||
state.duration = offsetWidth / props.speed;
|
|
||||||
state.animationClass = "play";
|
|
||||||
} else {
|
|
||||||
state.animationClass = "";
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}, 100);
|
|
||||||
}
|
|
||||||
function handleClick(event) {
|
|
||||||
emit("click", event);
|
|
||||||
}
|
|
||||||
function onClickIcon(event) {
|
|
||||||
if (props.closeMode)
|
|
||||||
state.showNoticebar = !props.closeMode;
|
|
||||||
emit("close", event);
|
|
||||||
}
|
|
||||||
function onAnimationEnd(event) {
|
|
||||||
state.firstRound = false;
|
|
||||||
emit("acrossEnd", event);
|
|
||||||
setTimeout(() => {
|
|
||||||
state.duration = (state.offsetWidth + state.wrapWidth) / props.speed;
|
|
||||||
state.animationClass = "play-infinite";
|
|
||||||
}, 0);
|
|
||||||
}
|
|
||||||
function startRollEasy() {
|
|
||||||
showhorseLamp();
|
|
||||||
state.timer = setInterval(showhorseLamp, ~~(props.height / props.speed / 4) * 1e3 + props.standTime);
|
|
||||||
}
|
|
||||||
function showhorseLamp() {
|
|
||||||
state.animate = true;
|
|
||||||
setTimeout(() => {
|
|
||||||
state.scrollList.push(state.scrollList[0]);
|
|
||||||
state.scrollList.shift();
|
|
||||||
state.animate = false;
|
|
||||||
}, ~~(props.height / props.speed / 4) * 1e3);
|
|
||||||
}
|
|
||||||
function startRoll() {
|
|
||||||
state.timer = setInterval(() => {
|
|
||||||
const chunk = 100;
|
|
||||||
for (let i = 0; i < chunk; i++)
|
|
||||||
scroll(i, !(i < chunk - 1));
|
|
||||||
}, props.standTime + 100 * props.speed);
|
|
||||||
}
|
|
||||||
function scroll(n, last) {
|
|
||||||
setTimeout(() => {
|
|
||||||
state.distance -= props.height / 100;
|
|
||||||
if (last) {
|
|
||||||
state.scrollList.push(state.scrollList[0]);
|
|
||||||
state.scrollList.shift();
|
|
||||||
state.distance = 0;
|
|
||||||
}
|
|
||||||
}, n * props.speed);
|
|
||||||
}
|
|
||||||
function go(item) {
|
|
||||||
emit(uni_modules_nutuiUni_components__constants_event.CLICK_EVENT, item);
|
|
||||||
}
|
|
||||||
function handleClickIcon() {
|
|
||||||
if (props.closeMode)
|
|
||||||
state.showNoticebar = !props.closeMode;
|
|
||||||
emit(uni_modules_nutuiUni_components__constants_event.CLOSE_EVENT, state.scrollList[0]);
|
|
||||||
}
|
|
||||||
common_vendor.onMounted(() => {
|
|
||||||
if (props.direction === "vertical") {
|
|
||||||
state.scrollList = [].concat(props.list);
|
|
||||||
setTimeout(() => {
|
|
||||||
props.complexAm ? startRoll() : startRollEasy();
|
|
||||||
}, props.standTime);
|
|
||||||
} else {
|
|
||||||
initScrollWrap();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
common_vendor.onActivated(() => {
|
|
||||||
if (state.keepAlive)
|
|
||||||
state.keepAlive = false;
|
|
||||||
});
|
|
||||||
common_vendor.onDeactivated(() => {
|
|
||||||
state.keepAlive = true;
|
|
||||||
clearInterval(state.timer);
|
|
||||||
});
|
|
||||||
common_vendor.onUnmounted(() => {
|
|
||||||
clearInterval(state.timer);
|
|
||||||
});
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: _ctx.direction === "across"
|
|
||||||
}, _ctx.direction === "across" ? common_vendor.e({
|
|
||||||
b: _ctx.leftIcon
|
|
||||||
}, _ctx.leftIcon ? {
|
|
||||||
c: common_vendor.p({
|
|
||||||
name: "notice",
|
|
||||||
size: "16px"
|
|
||||||
})
|
|
||||||
} : {}, {
|
|
||||||
d: common_vendor.t(_ctx.text),
|
|
||||||
e: common_vendor.n(wrapContentClass.value),
|
|
||||||
f: common_vendor.s(contentStyle.value),
|
|
||||||
g: common_vendor.o(
|
|
||||||
//@ts-ignore
|
|
||||||
(...args) => onAnimationEnd && onAnimationEnd(...args)
|
|
||||||
),
|
|
||||||
h: common_vendor.o(
|
|
||||||
//@ts-ignore
|
|
||||||
(...args) => onAnimationEnd && onAnimationEnd(...args)
|
|
||||||
),
|
|
||||||
i: common_vendor.n(`nut-noticebar__page-wrap wrap${state.id}`),
|
|
||||||
j: _ctx.closeMode || _ctx.$slots.rightIcon
|
|
||||||
}, _ctx.closeMode || _ctx.$slots.rightIcon ? {
|
|
||||||
k: common_vendor.p({
|
|
||||||
name: "circle-close"
|
|
||||||
}),
|
|
||||||
l: common_vendor.o(
|
|
||||||
//@ts-ignore
|
|
||||||
(...args) => onClickIcon && onClickIcon(...args)
|
|
||||||
)
|
|
||||||
} : {}, {
|
|
||||||
m: _ctx.closeMode ? 1 : "",
|
|
||||||
n: _ctx.closeMode ? 1 : "",
|
|
||||||
o: _ctx.wrapable ? 1 : "",
|
|
||||||
p: !state.showNoticebar ? 1 : "",
|
|
||||||
q: common_vendor.s(barStyle.value),
|
|
||||||
r: common_vendor.o(
|
|
||||||
//@ts-ignore
|
|
||||||
(...args) => handleClick && handleClick(...args)
|
|
||||||
)
|
|
||||||
}) : {}, {
|
|
||||||
s: state.scrollList.length > 0 && _ctx.direction === "vertical" && state.showNoticebar
|
|
||||||
}, state.scrollList.length > 0 && _ctx.direction === "vertical" && state.showNoticebar ? common_vendor.e({
|
|
||||||
t: common_vendor.f(state.scrollList, (item, index, i0) => {
|
|
||||||
return {
|
|
||||||
a: common_vendor.t(props.fieldName && common_vendor.unref(uni_modules_nutuiUni_components__utils_is.isObject)(item) ? item[props.fieldName] : item),
|
|
||||||
b: index,
|
|
||||||
c: common_vendor.o(($event) => go(item), index)
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
v: common_vendor.unref(uni_modules_nutuiUni_components__utils_pxCheck.pxCheck)(_ctx.height),
|
|
||||||
w: common_vendor.unref(uni_modules_nutuiUni_components__utils_pxCheck.pxCheck)(_ctx.height),
|
|
||||||
x: common_vendor.s(horseLampStyle.value),
|
|
||||||
y: _ctx.closeMode
|
|
||||||
}, _ctx.closeMode ? {
|
|
||||||
z: common_vendor.p({
|
|
||||||
name: "circle-close",
|
|
||||||
["custom-color"]: _ctx.customColor,
|
|
||||||
size: "11px"
|
|
||||||
})
|
|
||||||
} : {}, {
|
|
||||||
A: common_vendor.o(($event) => handleClickIcon()),
|
|
||||||
B: common_vendor.s(barStyle.value)
|
|
||||||
}) : {}, {
|
|
||||||
C: common_vendor.n(classes.value),
|
|
||||||
D: common_vendor.s(_ctx.customStyle)
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
});
|
|
||||||
wx.createComponent(_sfc_main);
|
|
||||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/noticebar/noticebar.js.map
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"component": true,
|
|
||||||
"usingComponents": {
|
|
||||||
"nut-icon": "../icon/icon"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<view class="{{C}}" style="{{D}}"><view wx:if="{{a}}" class="{{['nut-noticebar__page', m && 'nut-noticebar__page--withicon', n && 'nut-noticebar__page--close', o && 'nut-noticebar__page--wrapable', p && 'nut-hidden']}}" style="{{q}}" bindtap="{{r}}"><view wx:if="{{b}}" class="nut-noticebar__page-lefticon"><block wx:if="{{$slots.leftIcon}}"><slot name="leftIcon"></slot></block><block wx:else><nut-icon wx:if="{{c}}" u-i="21e61180-0" bind:__l="__l" u-p="{{c}}"/></block></view><view ref="wrap" class="{{i}}"><view ref="content" class="{{e}}" style="{{f}}" bindanimationend="{{g}}" bind:webkit-animation-end="{{h}}"><block wx:if="{{$slots.d}}"><slot></slot></block><block wx:else>{{d}}</block></view></view><view wx:if="{{j}}" class="nut-noticebar__page-righticon" catchtap="{{l}}"><block wx:if="{{$slots.rightIcon}}"><slot name="rightIcon"></slot></block><block wx:else><nut-icon wx:if="{{k}}" u-i="21e61180-1" bind:__l="__l" u-p="{{k}}"/></block></view></view><view wx:if="{{s}}" class="nut-noticebar__vertical" style="{{B}}"><view class="nut-noticebar__vertical-list" style="{{x}}"><view wx:for="{{t}}" wx:for-item="item" wx:key="b" class="nut-noticebar__vertical-item" style="{{'height:' + v + ';' + ('line-height:' + w)}}" bindtap="{{item.c}}">{{item.a}}</view></view><view class="go" bindtap="{{A}}"><block wx:if="{{$slots.rightIcon}}"><slot name="rightIcon"></slot></block><block wx:else><nut-icon wx:if="{{y}}" u-i="21e61180-2" bind:__l="__l" u-p="{{z}}"/></block></view></view></view>
|
|
||||||
@@ -1,174 +0,0 @@
|
|||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
/* stylelint-disable keyframes-name-pattern */
|
|
||||||
.nut-theme-dark .nut-noticebar__page {
|
|
||||||
color: var(--nut-dark-color, var(--nut-white, #fff));
|
|
||||||
background: var(--nut-dark-background2, #1b1b1b);
|
|
||||||
}
|
|
||||||
.nut-theme-dark .nut-noticebar__vertical {
|
|
||||||
color: var(--nut-dark-color, var(--nut-white, #fff));
|
|
||||||
}
|
|
||||||
.nut-noticebar__page {
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
height: var(--nut-noticebar-across-height, 40px);
|
|
||||||
padding: var(--nut-noticebar-box-padding, 0 16px);
|
|
||||||
font-size: var(--nut-noticebar-font-size, 14px);
|
|
||||||
color: var(--nut-noticebar-color, #d9500b);
|
|
||||||
background: var(--nut-noticebar-background, #fbf8dc);
|
|
||||||
}
|
|
||||||
.nut-noticebar__page--wrapable {
|
|
||||||
height: auto;
|
|
||||||
padding: var(--nut-noticebar-wrapable-padding, 16px);
|
|
||||||
}
|
|
||||||
.nut-noticebar__page--wrapable .nut-noticebar__page-wrap {
|
|
||||||
height: auto !important;
|
|
||||||
}
|
|
||||||
.nut-noticebar__page--wrapable .nut-noticebar__page-wrap .nut-noticebar__page-wrap-content {
|
|
||||||
position: relative;
|
|
||||||
word-wrap: break-word;
|
|
||||||
white-space: normal;
|
|
||||||
}
|
|
||||||
.nut-noticebar__page .nut-noticebar__page--withicon {
|
|
||||||
position: relative;
|
|
||||||
padding-right: 40px;
|
|
||||||
}
|
|
||||||
.nut-noticebar__page .nut-noticebar__page-lefticon {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
margin: var(--nut-noticebar-lefticon-margin, 0 10px);
|
|
||||||
background-size: 100% 100%;
|
|
||||||
}
|
|
||||||
.nut-noticebar__page .nut-noticebar__page-righticon {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
margin: var(--nut-noticebar-righticon-margin, 0 10px);
|
|
||||||
}
|
|
||||||
.nut-noticebar__page .nut-noticebar__page-wrap {
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
|
||||||
flex: 1;
|
|
||||||
height: var(--nut-noticebar-across-line-height, 24px);
|
|
||||||
overflow: hidden;
|
|
||||||
line-height: var(--nut-noticebar-across-line-height, 24px);
|
|
||||||
}
|
|
||||||
.nut-noticebar__page .nut-noticebar__page-wrap-content {
|
|
||||||
position: absolute;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
.nut-noticebar__page .nut-noticebar__page-wrap-content.nut-ellipsis {
|
|
||||||
display: inline-block;
|
|
||||||
max-width: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
.nut-noticebar__page .play {
|
|
||||||
animation: nut-notice-bar-play linear both running;
|
|
||||||
}
|
|
||||||
.nut-noticebar__page .play-infinite {
|
|
||||||
animation: nut-notice-bar-play-infinite linear infinite both running;
|
|
||||||
}
|
|
||||||
.nut-noticebar__page .play-vertical {
|
|
||||||
animation: nut-notice-bar-play-vertical linear infinite both running;
|
|
||||||
}
|
|
||||||
@keyframes nut-notice-bar-play {
|
|
||||||
to {
|
|
||||||
transform: translate3d(-100%, 0, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@keyframes nut-notice-bar-play-infinite {
|
|
||||||
to {
|
|
||||||
transform: translateX(-100%);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@keyframes nut-notice-bar-play-vertical {
|
|
||||||
to {
|
|
||||||
transform: translateY(var(--nut-noticebar-across-height, 40px));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.nut-noticebar__vertical {
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
height: var(--nut-noticebar-across-height, 40px);
|
|
||||||
padding: var(--nut-noticebar-box-padding, 0 16px);
|
|
||||||
overflow: hidden;
|
|
||||||
font-size: var(--nut-noticebar-font-size, 14px);
|
|
||||||
color: var(--nut-noticebar-color, #d9500b);
|
|
||||||
background: var(--nut-noticebar-background, #fbf8dc);
|
|
||||||
}
|
|
||||||
.nut-noticebar__vertical .nut-noticebar__vertical-list {
|
|
||||||
display: block;
|
|
||||||
flex: 1;
|
|
||||||
width: 100%;
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.nut-noticebar__vertical .nut-noticebar__vertical-list .nut-noticebar__vertical-item {
|
|
||||||
width: 100%;
|
|
||||||
height: var(--nut-noticebar-across-height, 40px);
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
.nut-noticebar__vertical .nut-noticebar-custom-item {
|
|
||||||
position: absolute;
|
|
||||||
top: 999999px;
|
|
||||||
}
|
|
||||||
.nut-noticebar__vertical .go {
|
|
||||||
display: flex;
|
|
||||||
align-self: center;
|
|
||||||
margin: var(--nut-noticebar-righticon-margin, 0 10px);
|
|
||||||
}
|
|
||||||
@@ -1,148 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../../../common/vendor.js");
|
|
||||||
const uni_modules_nutuiUni_components__constants_event = require("../_constants/event.js");
|
|
||||||
const uni_modules_nutuiUni_components__constants_prefix = require("../_constants/prefix.js");
|
|
||||||
require("../_utils/env.js");
|
|
||||||
const uni_modules_nutuiUni_components__utils_style = require("../_utils/style.js");
|
|
||||||
const form = require("../../../../form.js");
|
|
||||||
const uni_modules_nutuiUni_components__utils_is = require("../_utils/is.js");
|
|
||||||
const uni_modules_nutuiUni_components__utils_props = require("../_utils/props.js");
|
|
||||||
const switchProps = {
|
|
||||||
...uni_modules_nutuiUni_components__utils_props.commonProps,
|
|
||||||
/**
|
|
||||||
* @description 开关状态
|
|
||||||
*/
|
|
||||||
modelValue: {
|
|
||||||
type: [String, Number, Boolean],
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* @description 禁用状态
|
|
||||||
* @deprecated 即将弃用,请使用`disabled`
|
|
||||||
*/
|
|
||||||
disable: Boolean,
|
|
||||||
/**
|
|
||||||
* @description 禁用状态
|
|
||||||
*/
|
|
||||||
disabled: Boolean,
|
|
||||||
/**
|
|
||||||
* @description 打开时的背景颜色
|
|
||||||
*/
|
|
||||||
activeColor: String,
|
|
||||||
/**
|
|
||||||
* @description 关闭时的背景颜色
|
|
||||||
*/
|
|
||||||
inactiveColor: String,
|
|
||||||
/**
|
|
||||||
* @description 打开时文字描述
|
|
||||||
*/
|
|
||||||
activeText: String,
|
|
||||||
/**
|
|
||||||
* @description 关闭时文字描述
|
|
||||||
*/
|
|
||||||
inactiveText: String,
|
|
||||||
/**
|
|
||||||
* @description 打开时组件的值
|
|
||||||
*/
|
|
||||||
activeValue: {
|
|
||||||
type: [String, Number, Boolean],
|
|
||||||
default: true
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* @description 关闭组件的值
|
|
||||||
*/
|
|
||||||
inactiveValue: {
|
|
||||||
type: [String, Number, Boolean],
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* @description 加载状态
|
|
||||||
*/
|
|
||||||
loading: Boolean
|
|
||||||
};
|
|
||||||
const switchEmits = {
|
|
||||||
[uni_modules_nutuiUni_components__constants_event.UPDATE_MODEL_EVENT]: (val) => uni_modules_nutuiUni_components__utils_is.isBoolean(val) || uni_modules_nutuiUni_components__utils_is.isNumber(val) || uni_modules_nutuiUni_components__utils_is.isString(val),
|
|
||||||
[uni_modules_nutuiUni_components__constants_event.CHANGE_EVENT]: (val, evt) => (uni_modules_nutuiUni_components__utils_is.isBoolean(val) || uni_modules_nutuiUni_components__utils_is.isNumber(val) || uni_modules_nutuiUni_components__utils_is.isString(val)) && evt instanceof Object
|
|
||||||
};
|
|
||||||
if (!Math) {
|
|
||||||
NutIcon();
|
|
||||||
}
|
|
||||||
const NutIcon = () => "../icon/icon.js";
|
|
||||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-switch`;
|
|
||||||
const __default__ = common_vendor.defineComponent({
|
|
||||||
name: componentName,
|
|
||||||
options: {
|
|
||||||
virtualHost: true,
|
|
||||||
addGlobalClass: true,
|
|
||||||
styleIsolation: "shared"
|
|
||||||
}
|
|
||||||
});
|
|
||||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
||||||
...__default__,
|
|
||||||
props: switchProps,
|
|
||||||
emits: switchEmits,
|
|
||||||
setup(__props, { emit: __emit }) {
|
|
||||||
const props = __props;
|
|
||||||
const emit = __emit;
|
|
||||||
const legacyDisabled = common_vendor.computed(() => props.disabled || props.disable);
|
|
||||||
const disabled = form.useFormDisabled(legacyDisabled);
|
|
||||||
const isActive = common_vendor.computed(() => props.modelValue === props.activeValue);
|
|
||||||
const classes = common_vendor.computed(() => {
|
|
||||||
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName, {
|
|
||||||
[isActive.value ? "nut-switch-open" : "nut-switch-close"]: true,
|
|
||||||
[`${componentName}-disabled`]: disabled.value,
|
|
||||||
[`${componentName}-base`]: true
|
|
||||||
});
|
|
||||||
});
|
|
||||||
const styles = common_vendor.computed(() => {
|
|
||||||
const obj = {
|
|
||||||
backgroundColor: isActive.value ? props.activeColor : props.inactiveColor
|
|
||||||
};
|
|
||||||
return uni_modules_nutuiUni_components__utils_style.getMainStyle(props, obj);
|
|
||||||
});
|
|
||||||
let updateType = "";
|
|
||||||
function onClick(event) {
|
|
||||||
if (disabled.value || props.loading)
|
|
||||||
return;
|
|
||||||
const value = isActive.value ? props.inactiveValue : props.activeValue;
|
|
||||||
updateType = "click";
|
|
||||||
emit(uni_modules_nutuiUni_components__constants_event.UPDATE_MODEL_EVENT, value);
|
|
||||||
emit(uni_modules_nutuiUni_components__constants_event.CHANGE_EVENT, value, event);
|
|
||||||
}
|
|
||||||
common_vendor.watch(
|
|
||||||
() => props.modelValue,
|
|
||||||
(v) => {
|
|
||||||
if (updateType === "click")
|
|
||||||
updateType = "";
|
|
||||||
else
|
|
||||||
emit(uni_modules_nutuiUni_components__constants_event.CHANGE_EVENT, v);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: _ctx.loading
|
|
||||||
}, _ctx.loading ? {
|
|
||||||
b: common_vendor.p({
|
|
||||||
name: "loading1",
|
|
||||||
["custom-color"]: _ctx.activeColor
|
|
||||||
})
|
|
||||||
} : {}, {
|
|
||||||
c: _ctx.activeText
|
|
||||||
}, _ctx.activeText ? {
|
|
||||||
d: common_vendor.t(_ctx.activeText),
|
|
||||||
e: !isActive.value ? 1 : "",
|
|
||||||
f: common_vendor.t(_ctx.inactiveText),
|
|
||||||
g: isActive.value ? 1 : ""
|
|
||||||
} : {}, {
|
|
||||||
h: common_vendor.n(classes.value),
|
|
||||||
i: common_vendor.s(styles.value),
|
|
||||||
j: common_vendor.o(
|
|
||||||
//@ts-ignore
|
|
||||||
(...args) => onClick && onClick(...args)
|
|
||||||
)
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
});
|
|
||||||
wx.createComponent(_sfc_main);
|
|
||||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/switch/switch.js.map
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"component": true,
|
|
||||||
"usingComponents": {
|
|
||||||
"nut-icon": "../icon/icon"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<view class="{{h}}" style="{{i}}" bindtap="{{j}}"><view class="nut-switch-button"><block wx:if="{{a}}"><block wx:if="{{$slots.icon}}"><slot name="icon"></slot></block><block wx:else><nut-icon wx:if="{{b}}" u-i="cf15d9f0-0" bind:__l="__l" u-p="{{b}}"/></block></block><block wx:if="{{c}}"><view class="{{['nut-switch-label', 'open', e && 'nut-hidden']}}">{{d}}</view><view class="{{['nut-switch-label', 'close', g && 'nut-hidden']}}">{{f}}</view></block></view></view>
|
|
||||||
@@ -1,107 +0,0 @@
|
|||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
/**
|
|
||||||
* 这里是uni-app内置的常用样式变量
|
|
||||||
*
|
|
||||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
|
||||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
|
||||||
*
|
|
||||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
|
||||||
*/
|
|
||||||
/* 颜色变量 */
|
|
||||||
/* 行为相关颜色 */
|
|
||||||
/* 文字基本颜色 */
|
|
||||||
/* 背景颜色 */
|
|
||||||
/* 边框颜色 */
|
|
||||||
/* 尺寸变量 */
|
|
||||||
/* 文字尺寸 */
|
|
||||||
/* 图片尺寸 */
|
|
||||||
/* Border Radius */
|
|
||||||
/* 水平间距 */
|
|
||||||
/* 垂直间距 */
|
|
||||||
/* 透明度 */
|
|
||||||
/* 文章场景相关 */
|
|
||||||
.nut-theme-dark .nut-switch.nut-switch-close {
|
|
||||||
background-color: var(--nut-dark-background4, #323233);
|
|
||||||
}
|
|
||||||
.nut-switch {
|
|
||||||
display: inline-flex;
|
|
||||||
flex: 0 0 auto;
|
|
||||||
align-items: center;
|
|
||||||
cursor: pointer;
|
|
||||||
background-color: var(--nut-primary-color, #fa2c19);
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-position: center center;
|
|
||||||
background-size: 100% 100%;
|
|
||||||
border-radius: var(--nut-switch-border-radius, 21px);
|
|
||||||
}
|
|
||||||
.nut-switch .nut-icon-loading1 {
|
|
||||||
width: 12px;
|
|
||||||
height: 12px;
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
.nut-switch.nut-switch-close {
|
|
||||||
background-color: var(--nut-switch-close-bg-color, #ebebeb);
|
|
||||||
}
|
|
||||||
.nut-switch .nut-switch-button {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
background: var(--nut-white, #fff);
|
|
||||||
border-radius: 50%;
|
|
||||||
transition: transform 0.3s;
|
|
||||||
}
|
|
||||||
.nut-switch .nut-switch-button .nut-switch-label {
|
|
||||||
font-size: var(--nut-font-size-1, 12px);
|
|
||||||
color: var(--nut-white, #fff);
|
|
||||||
}
|
|
||||||
.nut-switch .nut-switch-button .nut-switch-label.open {
|
|
||||||
transform: translateX(-16px);
|
|
||||||
}
|
|
||||||
.nut-switch .nut-switch-button .nut-switch-label.close {
|
|
||||||
transform: translateX(16px);
|
|
||||||
}
|
|
||||||
.nut-switch.nut-switch-disabled {
|
|
||||||
opacity: 0.6;
|
|
||||||
}
|
|
||||||
.nut-switch.nut-switch-base {
|
|
||||||
min-width: var(--nut-switch-width, 36px);
|
|
||||||
height: var(--nut-switch-height, 21px);
|
|
||||||
overflow: hidden;
|
|
||||||
line-height: var(--nut-switch-line-height, 21px);
|
|
||||||
}
|
|
||||||
.nut-switch.nut-switch-base .nut-switch-button {
|
|
||||||
width: var(--nut-switch-inside-width, 13px);
|
|
||||||
height: var(--nut-switch-inside-height, 13px);
|
|
||||||
transform: var(--nut-switch-inside-close-transform, translateX(30%));
|
|
||||||
}
|
|
||||||
.nut-switch.nut-switch-base.nut-switch-open .nut-switch-button {
|
|
||||||
transform: var(--nut-switch-inside-open-transform, translateX(146%));
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const zTabsConfig = {};
|
|
||||||
exports.zTabsConfig = zTabsConfig;
|
|
||||||
//# sourceMappingURL=../../../../../../.sourcemap/mp-weixin/uni_modules/z-tabs/components/z-tabs/config/index.js.map
|
|
||||||
@@ -1,583 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../../../common/vendor.js");
|
|
||||||
const uni_modules_zTabs_components_zTabs_config_index = require("./config/index.js");
|
|
||||||
function _gc(key, defaultValue) {
|
|
||||||
let config = null;
|
|
||||||
if (uni_modules_zTabs_components_zTabs_config_index.zTabsConfig && Object.keys(uni_modules_zTabs_components_zTabs_config_index.zTabsConfig).length) {
|
|
||||||
config = uni_modules_zTabs_components_zTabs_config_index.zTabsConfig;
|
|
||||||
} else {
|
|
||||||
return defaultValue;
|
|
||||||
}
|
|
||||||
const value = config[_toKebab(key)];
|
|
||||||
return value === void 0 ? defaultValue : value;
|
|
||||||
}
|
|
||||||
function _toKebab(value) {
|
|
||||||
return value.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
||||||
}
|
|
||||||
function rpx2px(rpx) {
|
|
||||||
return common_vendor.index.upx2px(rpx);
|
|
||||||
}
|
|
||||||
const _sfc_main = {
|
|
||||||
name: "z-tabs",
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
currentIndex: 0,
|
|
||||||
currentSwiperIndex: 0,
|
|
||||||
bottomDotX: -1,
|
|
||||||
bottomDotXForIndex: 0,
|
|
||||||
showBottomDot: false,
|
|
||||||
shouldSetDx: true,
|
|
||||||
barCalcedWidth: 0,
|
|
||||||
pxBarWidth: 0,
|
|
||||||
scrollLeft: 0,
|
|
||||||
tabsSuperWidth: rpx2px(750),
|
|
||||||
tabsWidth: rpx2px(750),
|
|
||||||
tabsHeight: rpx2px(80),
|
|
||||||
tabsLeft: 0,
|
|
||||||
tabsContainerWidth: 0,
|
|
||||||
itemNodeInfos: [],
|
|
||||||
isFirstLoaded: false,
|
|
||||||
currentScrollLeft: 0,
|
|
||||||
changeTriggerFailed: false,
|
|
||||||
currentChanged: false
|
|
||||||
};
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
//数据源数组,支持形如['tab1','tab2']的格式或[{name:'tab1',value:1}]的格式
|
|
||||||
list: {
|
|
||||||
type: Array,
|
|
||||||
default: function() {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//当前选中的index
|
|
||||||
current: {
|
|
||||||
type: [Number, String],
|
|
||||||
default: _gc("current", 0)
|
|
||||||
},
|
|
||||||
//list数组长度超过scrollCount时滚动显示(不自动铺满全屏)
|
|
||||||
scrollCount: {
|
|
||||||
type: [Number, String],
|
|
||||||
default: _gc("scrollCount", 5)
|
|
||||||
},
|
|
||||||
//z-tabs样式
|
|
||||||
tabsStyle: {
|
|
||||||
type: Object,
|
|
||||||
default: function() {
|
|
||||||
return _gc("tabsStyle", {});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//自定义每个tab的宽度,默认为0,即代表根据内容自动撑开,单位rpx,支持传100、"100px"或"100rpx"
|
|
||||||
tabWidth: {
|
|
||||||
type: [Number, String],
|
|
||||||
default: _gc("tabWidth", 0)
|
|
||||||
},
|
|
||||||
//滑块宽度,单位rpx,支持传100、"100px"或"100rpx"
|
|
||||||
barWidth: {
|
|
||||||
type: [Number, String],
|
|
||||||
default: _gc("barWidth", 45)
|
|
||||||
},
|
|
||||||
//滑块高度,单位rpx,支持传100、"100px"或"100rpx"
|
|
||||||
barHeight: {
|
|
||||||
type: [Number, String],
|
|
||||||
default: _gc("barHeight", 8)
|
|
||||||
},
|
|
||||||
//swiper的宽度,单位rpx,支持传100、"100px"或"100rpx",默认为"750rpx"
|
|
||||||
swiperWidth: {
|
|
||||||
type: [Number, String],
|
|
||||||
default: _gc("swiperWidth", 750)
|
|
||||||
},
|
|
||||||
//滑块样式,其中的width和height将被barWidth和barHeight覆盖
|
|
||||||
barStyle: {
|
|
||||||
type: Object,
|
|
||||||
default: function() {
|
|
||||||
return _gc("barStyle", {});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//tabs与底部的间距,单位rpx,支持传100、"100px"或"100rpx"
|
|
||||||
bottomSpace: {
|
|
||||||
type: [Number, String],
|
|
||||||
default: _gc("bottomSpace", 8)
|
|
||||||
},
|
|
||||||
//切换tab时滑块动画模式,与swiper联动时有效,点击切换tab时无效,必须调用setDx。默认为line,即切换tab时滑块宽度保持不变,线性运动。可选值为worm,即为类似毛毛虫蠕动效果
|
|
||||||
barAnimateMode: {
|
|
||||||
type: String,
|
|
||||||
default: _gc("barAnimateMode", "line")
|
|
||||||
},
|
|
||||||
//list中item的name(标题)的key
|
|
||||||
nameKey: {
|
|
||||||
type: String,
|
|
||||||
default: _gc("nameKey", "name")
|
|
||||||
},
|
|
||||||
//list中item的value的key
|
|
||||||
valueKey: {
|
|
||||||
type: String,
|
|
||||||
default: _gc("valueKey", "value")
|
|
||||||
},
|
|
||||||
//激活状态tab的颜色
|
|
||||||
activeColor: {
|
|
||||||
type: String,
|
|
||||||
default: _gc("activeColor", "#007AFF")
|
|
||||||
},
|
|
||||||
//未激活状态tab的颜色
|
|
||||||
inactiveColor: {
|
|
||||||
type: String,
|
|
||||||
default: _gc("inactiveColor", "#666666")
|
|
||||||
},
|
|
||||||
//禁用状态tab的颜色
|
|
||||||
disabledColor: {
|
|
||||||
type: String,
|
|
||||||
default: _gc("disabledColor", "#bbbbbb")
|
|
||||||
},
|
|
||||||
//激活状态tab的样式
|
|
||||||
activeStyle: {
|
|
||||||
type: Object,
|
|
||||||
default: function() {
|
|
||||||
return _gc("activeStyle", {});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//未激活状态tab的样式
|
|
||||||
inactiveStyle: {
|
|
||||||
type: Object,
|
|
||||||
default: function() {
|
|
||||||
return _gc("inactiveStyle", {});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//禁用状态tab的样式
|
|
||||||
disabledStyle: {
|
|
||||||
type: Object,
|
|
||||||
default: function() {
|
|
||||||
return _gc("disabledStyle", {});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//z-tabs背景色
|
|
||||||
bgColor: {
|
|
||||||
type: String,
|
|
||||||
default: _gc("bgColor", "white")
|
|
||||||
},
|
|
||||||
//徽标数最大数字限制,超过这个数字将变成badgeMaxCount+
|
|
||||||
badgeMaxCount: {
|
|
||||||
type: [Number, String],
|
|
||||||
default: _gc("badgeMaxCount", 99)
|
|
||||||
},
|
|
||||||
//徽标样式,例如可自定义背景色,字体等等
|
|
||||||
badgeStyle: {
|
|
||||||
type: Object,
|
|
||||||
default: function() {
|
|
||||||
return _gc("badgeStyle", {});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//初始化时是否自动触发change事件
|
|
||||||
initTriggerChange: {
|
|
||||||
type: Boolean,
|
|
||||||
default: _gc("initTriggerChange", false)
|
|
||||||
},
|
|
||||||
//z-tabs中布局的单位,默认为rpx
|
|
||||||
unit: {
|
|
||||||
type: String,
|
|
||||||
default: _gc("unit", "rpx")
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.updateSubviewLayout();
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
current: {
|
|
||||||
handler(newVal) {
|
|
||||||
this.currentChanged && this._lockDx();
|
|
||||||
this.currentIndex = newVal;
|
|
||||||
this._preUpdateDotPosition(this.currentIndex);
|
|
||||||
if (this.initTriggerChange) {
|
|
||||||
if (newVal < this.list.length) {
|
|
||||||
this.$emit("change", newVal, this.list[newVal][this.valueKey]);
|
|
||||||
} else {
|
|
||||||
this.changeTriggerFailed = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.currentChanged = true;
|
|
||||||
},
|
|
||||||
immediate: true
|
|
||||||
},
|
|
||||||
list: {
|
|
||||||
handler(newVal) {
|
|
||||||
this._handleListChange(newVal);
|
|
||||||
},
|
|
||||||
immediate: false
|
|
||||||
},
|
|
||||||
bottomDotX(newVal) {
|
|
||||||
if (newVal >= 0) {
|
|
||||||
this.showBottomDot = true;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
finalBarWidth: {
|
|
||||||
handler(newVal) {
|
|
||||||
this.barCalcedWidth = newVal;
|
|
||||||
this.pxBarWidth = this.barCalcedWidth;
|
|
||||||
},
|
|
||||||
immediate: true
|
|
||||||
},
|
|
||||||
currentIndex: {
|
|
||||||
handler(newVal) {
|
|
||||||
this.currentSwiperIndex = newVal;
|
|
||||||
},
|
|
||||||
immediate: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
shouldScroll() {
|
|
||||||
return this.list.length > this.scrollCount;
|
|
||||||
},
|
|
||||||
finalTabsHeight() {
|
|
||||||
return this.tabsHeight;
|
|
||||||
},
|
|
||||||
tabStyle() {
|
|
||||||
const stl = this.shouldScroll ? { "flex-shrink": 0 } : { "flex": 1 };
|
|
||||||
if (this.finalTabWidth > 0) {
|
|
||||||
stl["width"] = this.finalTabWidth + "px";
|
|
||||||
} else {
|
|
||||||
delete stl.width;
|
|
||||||
}
|
|
||||||
return stl;
|
|
||||||
},
|
|
||||||
tabsListStyle() {
|
|
||||||
return this.shouldScroll ? {} : { "flex": 1 };
|
|
||||||
},
|
|
||||||
showAnimate() {
|
|
||||||
return this.isFirstLoaded && !this.shouldSetDx;
|
|
||||||
},
|
|
||||||
dotTransition() {
|
|
||||||
return this.showAnimate ? "transform .2s linear" : "none";
|
|
||||||
},
|
|
||||||
finalDotStyle() {
|
|
||||||
return { ...this.barStyle, width: this.barCalcedWidth + "px", height: this.finalBarHeight + "px", opacity: this.showBottomDot ? 1 : 0 };
|
|
||||||
},
|
|
||||||
finalTabWidth() {
|
|
||||||
return this._convertTextToPx(this.tabWidth);
|
|
||||||
},
|
|
||||||
finalBarWidth() {
|
|
||||||
return this._convertTextToPx(this._addUnit(this.barWidth, this.unit));
|
|
||||||
},
|
|
||||||
finalBarHeight() {
|
|
||||||
return this._convertTextToPx(this._addUnit(this.barHeight, this.unit));
|
|
||||||
},
|
|
||||||
finalSwiperWidth() {
|
|
||||||
return this._convertTextToPx(this.swiperWidth);
|
|
||||||
},
|
|
||||||
finalBottomSpace() {
|
|
||||||
return this._convertTextToPx(this._addUnit(this.bottomSpace, this.unit));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
//根据swiper的@transition实时更新底部dot位置
|
|
||||||
setDx(dx) {
|
|
||||||
if (!this.shouldSetDx)
|
|
||||||
return;
|
|
||||||
const isLineMode = this.barAnimateMode === "line";
|
|
||||||
const isWormMode = this.barAnimateMode === "worm";
|
|
||||||
let dxRate = dx / this.finalSwiperWidth;
|
|
||||||
this.currentSwiperIndex = this.currentIndex + parseInt(dxRate);
|
|
||||||
const isRight = dxRate > 0;
|
|
||||||
const barWidth = this.pxBarWidth;
|
|
||||||
if (this.currentSwiperIndex !== this.currentIndex) {
|
|
||||||
dxRate = dxRate - (this.currentSwiperIndex - this.currentIndex);
|
|
||||||
const currentNode = this.itemNodeInfos[this.currentSwiperIndex];
|
|
||||||
if (!!currentNode) {
|
|
||||||
this.bottomDotXForIndex = this._getBottomDotX(currentNode, barWidth);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const currentIndex = this.currentSwiperIndex;
|
|
||||||
let nextIndex = currentIndex + (isRight ? 1 : -1);
|
|
||||||
nextIndex = Math.max(0, nextIndex);
|
|
||||||
nextIndex = Math.min(nextIndex, this.itemNodeInfos.length - 1);
|
|
||||||
const currentNodeInfo = this.itemNodeInfos[currentIndex];
|
|
||||||
const nextNodeInfo = this.itemNodeInfos[nextIndex];
|
|
||||||
const nextBottomX = this._getBottomDotX(nextNodeInfo, barWidth);
|
|
||||||
if (isLineMode) {
|
|
||||||
this.bottomDotX = this.bottomDotXForIndex + (nextBottomX - this.bottomDotXForIndex) * Math.abs(dxRate);
|
|
||||||
} else if (isWormMode) {
|
|
||||||
if (isRight && currentIndex >= this.itemNodeInfos.length - 1 || !isRight && currentIndex <= 0)
|
|
||||||
return;
|
|
||||||
const spaceOffset = isRight ? nextNodeInfo.right - currentNodeInfo.left : currentNodeInfo.right - nextNodeInfo.left;
|
|
||||||
let barCalcedWidth = barWidth + spaceOffset * Math.abs(dxRate);
|
|
||||||
if (isRight) {
|
|
||||||
if (barCalcedWidth > nextBottomX - this.bottomDotX + barWidth) {
|
|
||||||
const barMinusWidth = barWidth + spaceOffset * (1 - dxRate);
|
|
||||||
this.bottomDotX = this.bottomDotXForIndex + (barCalcedWidth - barMinusWidth) / 2;
|
|
||||||
barCalcedWidth = barMinusWidth;
|
|
||||||
}
|
|
||||||
} else if (!isRight) {
|
|
||||||
if (barCalcedWidth > this.bottomDotXForIndex + barWidth - nextBottomX) {
|
|
||||||
const barMinusWidth = barWidth + spaceOffset * (1 + dxRate);
|
|
||||||
barCalcedWidth = barMinusWidth;
|
|
||||||
this.bottomDotX = nextBottomX;
|
|
||||||
} else {
|
|
||||||
this.bottomDotX = this.bottomDotXForIndex - (barCalcedWidth - barWidth);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
barCalcedWidth = Math.max(barCalcedWidth, barWidth);
|
|
||||||
this.barCalcedWidth = barCalcedWidth;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//在swiper的@animationfinish中通知z-tabs结束多setDx的锁定,若在父组件中调用了setDx,则必须调用unlockDx
|
|
||||||
unlockDx() {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.shouldSetDx = true;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
//更新z-tabs内部布局
|
|
||||||
updateSubviewLayout(tryCount = 0) {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
let delayTime = 10;
|
|
||||||
setTimeout(() => {
|
|
||||||
this._getNodeClientRect(".z-tabs-scroll-view-conatiner").then((res) => {
|
|
||||||
if (res) {
|
|
||||||
if (!res[0].width && tryCount < 10) {
|
|
||||||
setTimeout(() => {
|
|
||||||
tryCount++;
|
|
||||||
this.updateSubviewLayout(tryCount);
|
|
||||||
}, 50);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.tabsWidth = res[0].width;
|
|
||||||
this.tabsHeight = res[0].height;
|
|
||||||
this.tabsLeft = res[0].left;
|
|
||||||
this._handleListChange(this.list);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this._getNodeClientRect(".z-tabs-conatiner").then((res) => {
|
|
||||||
if (res && res[0].width) {
|
|
||||||
this.tabsSuperWidth = res[0].width;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}, delayTime);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
//点击了tabs
|
|
||||||
tabsClick(index, item) {
|
|
||||||
if (item.disabled)
|
|
||||||
return;
|
|
||||||
if (this.currentIndex != index) {
|
|
||||||
this.shouldSetDx = false;
|
|
||||||
this.$emit("change", index, item[this.valueKey]);
|
|
||||||
this.currentIndex = index;
|
|
||||||
this._preUpdateDotPosition(index);
|
|
||||||
} else {
|
|
||||||
this.$emit("secondClick", index, item[this.valueKey]);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//scroll-view滚动
|
|
||||||
scroll(e) {
|
|
||||||
this.currentScrollLeft = e.detail.scrollLeft;
|
|
||||||
},
|
|
||||||
//锁定dx,用于避免在swiper被动触发滚动时候执行setDx中的代码
|
|
||||||
_lockDx() {
|
|
||||||
this.shouldSetDx = false;
|
|
||||||
},
|
|
||||||
//更新底部dot位置之前的预处理
|
|
||||||
_preUpdateDotPosition(index) {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
common_vendor.index.createSelectorQuery().in(this).select(".z-tabs-scroll-view").fields({
|
|
||||||
scrollOffset: true
|
|
||||||
}, (data) => {
|
|
||||||
if (data) {
|
|
||||||
this.currentScrollLeft = data.scrollLeft;
|
|
||||||
this._updateDotPosition(index);
|
|
||||||
} else {
|
|
||||||
this._updateDotPosition(index);
|
|
||||||
}
|
|
||||||
}).exec();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
//更新底部dot位置
|
|
||||||
_updateDotPosition(index) {
|
|
||||||
if (index >= this.itemNodeInfos.length)
|
|
||||||
return;
|
|
||||||
this.$nextTick(async () => {
|
|
||||||
let node = this.itemNodeInfos[index];
|
|
||||||
let offset = 0;
|
|
||||||
let tabsContainerWidth = this.tabsContainerWidth;
|
|
||||||
if (JSON.stringify(this.activeStyle) !== "{}") {
|
|
||||||
const nodeRes = await this._getNodeClientRect(`#z-tabs-item-${index}`, true);
|
|
||||||
if (nodeRes) {
|
|
||||||
node = nodeRes[0];
|
|
||||||
offset = this.currentScrollLeft;
|
|
||||||
this.tabsHeight = Math.max(node.height + rpx2px(28), this.tabsHeight);
|
|
||||||
tabsContainerWidth = 0;
|
|
||||||
for (let i = 0; i < this.itemNodeInfos.length; i++) {
|
|
||||||
let oldNode = this.itemNodeInfos[i];
|
|
||||||
tabsContainerWidth += i === index ? node.width : oldNode.width;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (node) {
|
|
||||||
this.bottomDotX = this._getBottomDotX(node, this.finalBarWidth, offset);
|
|
||||||
}
|
|
||||||
this.bottomDotXForIndex = this.bottomDotX;
|
|
||||||
if (this.tabsWidth) {
|
|
||||||
setTimeout(() => {
|
|
||||||
let scrollLeft = this.bottomDotX - this.tabsWidth / 2 + this.finalBarWidth / 2;
|
|
||||||
scrollLeft = Math.max(0, scrollLeft);
|
|
||||||
if (tabsContainerWidth) {
|
|
||||||
scrollLeft = Math.min(scrollLeft, tabsContainerWidth - this.tabsWidth + 10);
|
|
||||||
}
|
|
||||||
if (this.shouldScroll && tabsContainerWidth > this.tabsWidth) {
|
|
||||||
this.scrollLeft = scrollLeft;
|
|
||||||
}
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.isFirstLoaded = true;
|
|
||||||
});
|
|
||||||
}, 200);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 处理list改变
|
|
||||||
_handleListChange(newVal) {
|
|
||||||
this.$nextTick(async () => {
|
|
||||||
if (newVal.length) {
|
|
||||||
let itemNodeInfos = [];
|
|
||||||
let tabsContainerWidth = 0;
|
|
||||||
let delayTime = 0;
|
|
||||||
setTimeout(async () => {
|
|
||||||
for (let i = 0; i < newVal.length; i++) {
|
|
||||||
const nodeRes = await this._getNodeClientRect(`#z-tabs-item-${i}`, true);
|
|
||||||
if (nodeRes) {
|
|
||||||
const node = nodeRes[0];
|
|
||||||
node.left += this.currentScrollLeft;
|
|
||||||
itemNodeInfos.push(node);
|
|
||||||
tabsContainerWidth += node.width;
|
|
||||||
}
|
|
||||||
if (i === this.currentIndex) {
|
|
||||||
this.itemNodeInfos = itemNodeInfos;
|
|
||||||
this.tabsContainerWidth = tabsContainerWidth;
|
|
||||||
this._updateDotPosition(this.currentIndex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.itemNodeInfos = itemNodeInfos;
|
|
||||||
this.tabsContainerWidth = tabsContainerWidth;
|
|
||||||
this._updateDotPosition(this.currentIndex);
|
|
||||||
}, delayTime);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (this.initTriggerChange && this.changeTriggerFailed && newVal.length) {
|
|
||||||
if (this.current < newVal.length) {
|
|
||||||
this.$emit("change", this.current, newVal[this.current][this.valueKey]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//根据node获取bottomX
|
|
||||||
_getBottomDotX(node, barWidth = this.finalBarWidth, offset = 0) {
|
|
||||||
return node.left + node.width / 2 - barWidth / 2 + offset - this.tabsLeft;
|
|
||||||
},
|
|
||||||
//获取节点信息
|
|
||||||
_getNodeClientRect(select, withRefArr = false) {
|
|
||||||
const res = common_vendor.index.createSelectorQuery().in(this);
|
|
||||||
res.select(select).boundingClientRect();
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
res.exec((data) => {
|
|
||||||
resolve(data && data != "" && data != void 0 && data.length ? data : false);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
//格式化badge中的count
|
|
||||||
_formatCount(count) {
|
|
||||||
if (!count)
|
|
||||||
return "";
|
|
||||||
if (count > this.badgeMaxCount) {
|
|
||||||
return this.badgeMaxCount + "+";
|
|
||||||
}
|
|
||||||
return count.toString();
|
|
||||||
},
|
|
||||||
//将文本的px或者rpx转为px的值
|
|
||||||
_convertTextToPx(text) {
|
|
||||||
const dataType = Object.prototype.toString.call(text);
|
|
||||||
if (dataType === "[object Number]") {
|
|
||||||
return rpx2px(text);
|
|
||||||
}
|
|
||||||
let isRpx = false;
|
|
||||||
if (text.indexOf("rpx") !== -1 || text.indexOf("upx") !== -1) {
|
|
||||||
text = text.replace("rpx", "").replace("upx", "");
|
|
||||||
isRpx = true;
|
|
||||||
} else if (text.indexOf("px") !== -1) {
|
|
||||||
text = text.replace("px", "");
|
|
||||||
} else {
|
|
||||||
text = rpx2px(text);
|
|
||||||
}
|
|
||||||
if (!isNaN(text)) {
|
|
||||||
if (isRpx)
|
|
||||||
return Number(rpx2px(text));
|
|
||||||
return Number(text);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
},
|
|
||||||
// 添加单位
|
|
||||||
_addUnit(value, unit) {
|
|
||||||
if (Object.prototype.toString.call(value) === "[object String]") {
|
|
||||||
let tempValue = value;
|
|
||||||
tempValue = tempValue.replace("rpx", "").replace("upx", "").replace("px", "");
|
|
||||||
if (value.indexOf("rpx") === -1 && value.indexOf("upx") === -1 && value.indexOf("px") !== -1) {
|
|
||||||
tempValue = parseFloat(tempValue) * 2;
|
|
||||||
}
|
|
||||||
value = tempValue;
|
|
||||||
}
|
|
||||||
return unit === "rpx" ? value + "rpx" : value / 2 + "px";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
||||||
return {
|
|
||||||
a: common_vendor.f($props.list, (item, index, i0) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: common_vendor.t(item[$props.nameKey] || item),
|
|
||||||
b: item.disabled ? 1 : "",
|
|
||||||
c: common_vendor.s({
|
|
||||||
color: item.disabled ? $props.disabledColor : $data.currentIndex === index ? $props.activeColor : $props.inactiveColor
|
|
||||||
}),
|
|
||||||
d: common_vendor.s(item.disabled ? $props.disabledStyle : $data.currentIndex === index ? $props.activeStyle : $props.inactiveStyle),
|
|
||||||
e: item.badge && $options._formatCount(item.badge.count).length
|
|
||||||
}, item.badge && $options._formatCount(item.badge.count).length ? {
|
|
||||||
f: common_vendor.t($options._formatCount(item.badge.count)),
|
|
||||||
g: $props.unit === "rpx" ? 1 : "",
|
|
||||||
h: $props.unit === "px" ? 1 : "",
|
|
||||||
i: common_vendor.s($props.badgeStyle)
|
|
||||||
} : {}, {
|
|
||||||
j: `z-tabs-item-${index}`,
|
|
||||||
k: `z-tabs-item-${index}`,
|
|
||||||
l: index,
|
|
||||||
m: common_vendor.o(($event) => $options.tabsClick(index, item), index)
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
b: $props.unit === "rpx" ? 1 : "",
|
|
||||||
c: $props.unit === "px" ? 1 : "",
|
|
||||||
d: common_vendor.s($options.tabStyle),
|
|
||||||
e: common_vendor.s($options.tabsListStyle),
|
|
||||||
f: common_vendor.s({
|
|
||||||
marginTop: -$options.finalBottomSpace + "px"
|
|
||||||
}),
|
|
||||||
g: common_vendor.s({
|
|
||||||
transform: `translateX(${$data.bottomDotX}px)`,
|
|
||||||
transition: $options.dotTransition,
|
|
||||||
background: $props.activeColor
|
|
||||||
}),
|
|
||||||
h: common_vendor.s($options.finalDotStyle),
|
|
||||||
i: common_vendor.s({
|
|
||||||
width: $data.tabsContainerWidth + "px",
|
|
||||||
bottom: $options.finalBottomSpace + "px"
|
|
||||||
}),
|
|
||||||
j: common_vendor.s($options.tabsListStyle),
|
|
||||||
k: $data.scrollLeft,
|
|
||||||
l: $data.isFirstLoaded,
|
|
||||||
m: common_vendor.o((...args) => $options.scroll && $options.scroll(...args)),
|
|
||||||
n: common_vendor.s({
|
|
||||||
background: $props.bgColor
|
|
||||||
}),
|
|
||||||
o: common_vendor.s({
|
|
||||||
height: $props.unit === "rpx" ? "80rpx" : "40px"
|
|
||||||
}),
|
|
||||||
p: common_vendor.s($props.tabsStyle)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-0ac4bf81"]]);
|
|
||||||
wx.createComponent(Component);
|
|
||||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/z-tabs/components/z-tabs/z-tabs.js.map
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"component": true,
|
|
||||||
"usingComponents": {}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<view class="z-tabs-conatiner data-v-0ac4bf81" style="{{n + ';' + o + ';' + p}}"><view class="z-tabs-left data-v-0ac4bf81"><slot name="left"/></view><view ref="z-tabs-scroll-view-conatiner" class="z-tabs-scroll-view-conatiner data-v-0ac4bf81"><scroll-view ref="z-tabs-scroll-view" class="z-tabs-scroll-view data-v-0ac4bf81" scroll-x="{{true}}" scroll-left="{{k}}" show-scrollbar="{{false}}" scroll-with-animation="{{l}}" bindscroll="{{m}}"><view class="z-tabs-list-container data-v-0ac4bf81" style="{{j}}"><view class="z-tabs-list data-v-0ac4bf81" style="{{e + ';' + f}}"><view wx:for="{{a}}" wx:for-item="item" wx:key="l" ref="{{item.j}}" id="{{item.k}}" class="z-tabs-item data-v-0ac4bf81" style="{{d}}" bindtap="{{item.m}}"><view class="z-tabs-item-title-container data-v-0ac4bf81"><text class="{{['data-v-0ac4bf81', b && 'z-tabs-item-title-rpx', c && 'z-tabs-item-title-px', item.b && 'z-tabs-item-title-disabled']}}" style="{{item.c + ';' + item.d}}">{{item.a}}</text><text wx:if="{{item.e}}" class="{{['z-tabs-item-badge', 'data-v-0ac4bf81', item.g && 'z-tabs-item-badge-rpx', item.h && 'z-tabs-item-badge-px']}}" style="{{item.i}}">{{item.f}}</text></view></view></view><view class="z-tabs-bottom data-v-0ac4bf81" style="{{i}}"><view ref="z-tabs-bottom-dot" class="z-tabs-bottom-dot data-v-0ac4bf81" style="{{g + ';' + h}}"/></view></view></scroll-view></view><view class="z-tabs-right data-v-0ac4bf81"><slot name="right"/></view></view>
|
|
||||||
@@ -1,110 +0,0 @@
|
|||||||
|
|
||||||
.z-tabs-conatiner.data-v-0ac4bf81{
|
|
||||||
|
|
||||||
overflow: hidden;
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
flex-direction: row;
|
|
||||||
}
|
|
||||||
.z-tabs-scroll-view-conatiner.data-v-0ac4bf81{
|
|
||||||
flex: 1;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
display: flex;
|
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
flex-direction: row;
|
|
||||||
}
|
|
||||||
.z-tabs-scroll-view.data-v-0ac4bf81 ::-webkit-scrollbar {
|
|
||||||
display: none;
|
|
||||||
-webkit-appearance: none;
|
|
||||||
width: 0 !important;
|
|
||||||
height: 0 !important;
|
|
||||||
background: transparent;
|
|
||||||
}
|
|
||||||
.z-tabs-scroll-view.data-v-0ac4bf81{
|
|
||||||
flex-direction: row;
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
.z-tabs-list-container.data-v-0ac4bf81{
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
.z-tabs-list.data-v-0ac4bf81,.z-tabs-list-container.data-v-0ac4bf81{
|
|
||||||
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
flex-direction: row;
|
|
||||||
}
|
|
||||||
.z-tabs-item.data-v-0ac4bf81{
|
|
||||||
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
padding: 0px 20rpx;
|
|
||||||
}
|
|
||||||
.z-tabs-item-title-container.data-v-0ac4bf81{
|
|
||||||
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.z-tabs-item-title-rpx.data-v-0ac4bf81{
|
|
||||||
font-size: 30rpx;
|
|
||||||
}
|
|
||||||
.z-tabs-item-title-px.data-v-0ac4bf81{
|
|
||||||
font-size: 15px;
|
|
||||||
}
|
|
||||||
.z-tabs-item-title-disabled.data-v-0ac4bf81{
|
|
||||||
|
|
||||||
cursor: not-allowed;
|
|
||||||
}
|
|
||||||
.z-tabs-item-badge.data-v-0ac4bf81{
|
|
||||||
background-color: #ec5b56;
|
|
||||||
color: white;
|
|
||||||
border-radius: 100px;
|
|
||||||
}
|
|
||||||
.z-tabs-item-badge-rpx.data-v-0ac4bf81{
|
|
||||||
margin-left: 8rpx;
|
|
||||||
font-size: 22rpx;
|
|
||||||
padding: 0rpx 10rpx;
|
|
||||||
}
|
|
||||||
.z-tabs-item-badge-px.data-v-0ac4bf81{
|
|
||||||
margin-left: 4px;
|
|
||||||
font-size: 11px;
|
|
||||||
padding: 0px 5px;
|
|
||||||
}
|
|
||||||
.z-tabs-bottom.data-v-0ac4bf81{
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
.z-tabs-bottom-dot.data-v-0ac4bf81{
|
|
||||||
border-radius: 100px;
|
|
||||||
}
|
|
||||||
.z-tabs-left.data-v-0ac4bf81,.z-tabs-right.data-v-0ac4bf81{
|
|
||||||
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user