This commit is contained in:
zmj 2024-05-09 18:01:57 +08:00
parent 60bc563e95
commit afa853bafa
7 changed files with 355 additions and 129 deletions

View File

@ -1,141 +1,148 @@
<template>
<up-popup :show="show" closeable round="10" @close="close" :safeAreaInsetBottom="false">
<view class="good-popup">
<view class="head-title">
{{datas.is_bulk ? '称重商品' : '计件商品'}}
</view>
<view class="row">
<view>商品名称</view>
<view>{{datas.name || datas.goods_name}}</view>
</view>
<view class="row">
<view>商品单位</view>
<view>{{datas.unit_name}}</view>
</view>
<view class="row">
<view>商品价格</view>
<view>¥ {{datas.sell}}</view>
</view>
<view class="row">
<view>小计</view>
<view style="color: #F55726;">¥ {{subtotal}}</view>
</view>
<view v-if="datas.is_bulk" class="row">
<view>购买重量<text style="color: #F55726;">*</text></view>
<view style="flex: 1;">
<up-input v-model="datas.cart_num" type="number" border="none" placeholder="请输入购买重量" inputAlign="right"></up-input>
</view>
</view>
<view v-else class="row">
<view>购买数量<text style="color: #F55726;">*</text></view>
<view style="flex: 1;">
<up-input v-model="datas.cart_num" type="number" border="none" placeholder="请输入购买数量" inputAlign="right"></up-input>
</view>
</view>
<view class="row" style="padding-top: 30px;padding-bottom: 30rpx;">
<view style="width: 30%;margin-right: 30rpx;">
<up-button @click="close" color="#f7f7f7"><text style="color: #333;">取消</text></up-button>
</view>
<view style="flex: 1;">
<up-button @click="change" color="#20b128">确定</up-button>
</view>
</view>
</view>
</up-popup>
<up-popup :show="show" closeable round="10" @close="close" :safeAreaInsetBottom="false">
<view class="good-popup">
<view class="head-title">
{{datas.is_bulk ? '称重商品' : '计件商品'}}
</view>
<view class="row">
<view>商品名称</view>
<view>{{datas.name || datas.goods_name}}</view>
</view>
<view class="row">
<view>商品单位</view>
<view>{{datas.unit_name}}</view>
</view>
<view class="row">
<view>商品价格</view>
<view>¥ {{datas.sell}}</view>
</view>
<view class="row">
<view>小计</view>
<view style="color: #F55726;">¥ {{subtotal}}</view>
</view>
<view v-if="datas.is_bulk" class="row">
<view>购买重量<text style="color: #F55726;">*</text></view>
<view style="flex: 1;">
<up-input v-model="datas.cart_num" :cursorSpacing='120' type="number" border="none"
placeholder="请输入购买重量" inputAlign="right"></up-input>
</view>
</view>
<view v-else class="row">
<view>购买数量<text style="color: #F55726;">*</text></view>
<view style="flex: 1;">
<up-input v-model="datas.cart_num" :cursorSpacing='120' type="number" border="none"
placeholder="请输入购买数量" inputAlign="right"></up-input>
</view>
</view>
<view class="row" style="padding-top: 30px;padding-bottom: 30rpx;">
<view style="width: 30%;margin-right: 30rpx;">
<up-button @click="close" color="#f7f7f7"><text style="color: #333;">取消</text></up-button>
</view>
<view style="flex: 1;">
<up-button @click="change" color="#20b128">确定</up-button>
</view>
</view>
</view>
</up-popup>
</template>
<script setup>
import { computed, ref } from "vue"
import { toast } from "../uni_modules/uview-plus";
import {
computed,
ref
} from "vue"
import {
toast
} from "../uni_modules/uview-plus";
const props = defineProps({
show: {
type: Boolean,
default: false
},
})
const datas = ref({
cart_num: ''
});
const setData = (e)=>{
datas.value = e;
}
const props = defineProps({
show: {
type: Boolean,
default: false
},
})
const emit = defineEmits(['close', 'change']);
const close = () => {
emit('close');
}
const datas = ref({
cart_num: ''
});
const setData = (e) => {
datas.value = e;
}
const change = () => {
if(subtotal.value<=0) {
uni.$u.toast('金额不可小于等于0');
datas.value.cart_num = '';
return ;
}
emit('change', datas.value);
}
const subtotal = computed(()=>{
let num = +datas.value.cart_num || 0;
let sell = +datas.value.sell;
return Math.ceil(num * sell * 100) / 100
})
defineExpose({
setData
})
const emit = defineEmits(['close', 'change']);
const close = () => {
emit('close');
}
const change = () => {
if (subtotal.value <= 0) {
uni.$u.toast('金额不可小于等于0');
datas.value.cart_num = '';
return;
}
emit('change', datas.value);
}
const subtotal = computed(() => {
let num = +datas.value.cart_num || 0;
let sell = +datas.value.sell;
return Math.ceil(num * sell * 100) / 100
})
defineExpose({
setData
})
</script>
<style scoped lang="scss">
.good-popup {
padding: 30rpx;
.good-popup {
padding: 30rpx;
.head-title {
font-weight: bold;
text-align: center;
margin-bottom: 20rpx;
}
.head-title {
font-weight: bold;
text-align: center;
margin-bottom: 20rpx;
}
.row {
display: flex;
align-items: center;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1rpx solid #f6f6f6;
margin-bottom: 20rpx;
.row {
display: flex;
align-items: center;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1rpx solid #f6f6f6;
margin-bottom: 20rpx;
&:last-child {
border-bottom: none;
margin-bottom: 0;
}
&:last-child {
border-bottom: none;
margin-bottom: 0;
}
.content {
.top {
display: flex;
.content {
.top {
display: flex;
view {
margin-right: 20rpx;
}
}
view {
margin-right: 20rpx;
}
}
.bottom {}
}
.bottom {}
}
image {
width: 40rpx;
height: 40rpx;
flex-shrink: 0;
}
}
}
image {
width: 40rpx;
height: 40rpx;
flex-shrink: 0;
}
}
}
@keyframes disappear {
to {
opacity: 0;
/* 渐隐 */
transform: scale(0);
/* 缩小 */
}
}
@keyframes disappear {
to {
opacity: 0;
/* 渐隐 */
transform: scale(0);
/* 缩小 */
}
}
</style>

View File

@ -0,0 +1,11 @@
<template>
<view class="">
detail文件
</view>
</template>
<script>
</script>
<style>
</style>

View File

@ -1,17 +1,186 @@
<template>
<view class="content">
<view class="">
<view class="cell-li">
<view class="cell-tit">
反馈类型
</view>
<view class="" style="display: flex;margin: 20rpx 0;">
<view class="types">
注册
</view>
<view class="types">
注册
</view>
</view>
<view class="type-detail" @click="showTypeDetail=true">
<text>未收到短信</text>
<up-icon name="arrow-down"></up-icon>
</view>
<up-picker confirmColor='#20B128' @confirm='confirm' @cancel='showTypeDetail=false' :show="showTypeDetail"
:columns="columns"></up-picker>
</view>
<view class="cell-li">
<view class="cell-tit" style="margin-bottom: 20rpx;">
反馈内容
</view>
<up-textarea v-model="cont" style="background-color: #F5F5F5;" placeholder="请输入内容" count></up-textarea>
</view>
<view class="cell-li">
<view class="cell-tit" style="margin-bottom: 20rpx;">
图片上传
</view>
<up-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple
:maxCount="10"></up-upload>
</view>
<view class="cell-li">
<view class="cell-tit" style="margin-bottom: 20rpx;">
联系方式
</view>
<up-input placeholder="请填写您的姓名" style="background-color: #F5F5F5;margin-bottom: 20rpx;" border="surround"
v-model="formData.name"></up-input>
<up-input placeholder="请输入您的电话或者邮箱" style="background-color: #F5F5F5;" border="surround"
v-model="formData.phone"></up-input>
</view>
<view class="btn">
<up-button text="提交反馈" shape='circle' color="#20B128"></up-button>
<view style="display: flex;align-items: center;margin-top: 20rpx;">
<view style="margin: 0 auto; display: flex;" @click="navgo('/pageQuota/feedBack/list')">
反馈记录 <up-icon name="arrow-right"></up-icon>
</view>
</view>
</view>
</view>
</template>
<script setup>
import {
ref,
reactive
} from "vue"
const showTypeDetail = ref(false)
const columns = reactive([
['中国', '美国', '日本']
]);
const confirm = (e) => {
console.log(e)
showTypeDetail.value = false
}
const cont = ref('')
const formData = reactive({
name: "",
phone: ''
})
const navgo = (url) => {
uni.navigateTo({
url
})
}
//
const fileList1 = ref([]);
//
const deletePic = (event) => {
fileList1.value.splice(event.index, 1);
};
//
const afterRead = async (event) => {
// mutiple true , file
let lists = [].concat(event.file);
let fileListLen = fileList1.value.length;
lists.map((item) => {
fileList1.value.push({
...item,
status: 'uploading',
message: '上传中',
});
});
for (let i = 0; i < lists.length; i++) {
const result = await uploadFilePromise(lists[i].url);
let item = fileList1.value[fileListLen];
fileList1.value.splice(fileListLen, 1, {
...item,
status: 'success',
message: '',
url: result,
});
fileListLen++;
}
};
const uploadFilePromise = (url) => {
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: 'http://192.168.2.21:7001/upload', //
filePath: url,
name: 'file',
formData: {
user: 'test',
},
success: (res) => {
setTimeout(() => {
resolve(res.data.data);
}, 1000);
},
});
});
};
</script>
<style lang="scss">
.content {
padding: 20rpx;
min-height: 100vh;
background-color: white;
.cell-li {
margin-bottom: 50rpx;
}
.cell-tit {
position: relative;
}
.cell-tit::after {
content: '';
width: 5rpx;
height: 20rpx;
border-radius: 20rpx;
background-color: #20B128;
position: absolute;
left: -10rpx;
top: 5rpx;
}
.types {
width: 150rpx;
height: 70rpx;
background-color: #20B128;
color: white;
text-align: center;
line-height: 70rpx;
border-radius: 50rpx;
margin-right: 20rpx;
}
.type-detail {
background-color: #F5F5F5;
padding: 20rpx;
display: flex;
justify-content: space-between;
}
}
</style>

View File

@ -0,0 +1,11 @@
<template>
<view class="">
list列表
</view>
</template>
<script>
</script>
<style>
</style>

View File

@ -69,8 +69,9 @@
<up-button shape='circle' color='#20B128' @click="submit" text="提交"></up-button>
</view>
</view>
<up-empty v-else mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png">
<up-empty @click='test2' v-else mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png">
</up-empty>
<button @click="test2">叫我按钮</button>
</up-transition>
<!-- 报价记录 -->
<up-transition :show="showGoods2" mode="slide-right">
@ -138,6 +139,12 @@
OpurchaseGoodsOfferListApi
} from "@/api/quotation.js"
const test2 = () => {
console.log("点解")
uni.navigateTo({
url: '/pages/index/index'
})
}
// url
const successPng = ref('https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/739c3202405071458553459.png')
const errPng = ref('https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/04c2c202405071501462462.png')

View File

@ -117,6 +117,20 @@
"navigationBarTitleText": "意见反馈",
"enablePullDownRefresh": false
}
},
{
"path": "feedBack/list",
"style": {
"navigationBarTitleText": "反馈记录",
"enablePullDownRefresh": false
}
},
{
"path": "feedBack/detail",
"style": {
"navigationBarTitleText": "反馈详情",
"enablePullDownRefresh": false
}
}
]
}

View File

@ -173,6 +173,18 @@
getCurrentInstance
} from 'vue';
const test = () => {
uni.navigateTo({
url: '/pageQuota/quotation/index'
})
}
/*商品列表滚动隐藏头部导航 */
const instance = getCurrentInstance(); //
const targetHeight = ref(0)
@ -185,11 +197,6 @@
}
/*商品列表滚动隐藏头部导航结束 */
const test = () => {
uni.navigateTo({
url: '/pageQuota/quotation/index'
})
}
const cartStore = useCartStore();
const show = ref(0);