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

View File

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

View File

@ -1,17 +1,186 @@
<template> <template>
<view class="content"> <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>
<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> </view>
</template> </template>
<script setup> <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> </script>
<style lang="scss"> <style lang="scss">
.content { .content {
padding: 20rpx; 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> </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> <up-button shape='circle' color='#20B128' @click="submit" text="提交"></up-button>
</view> </view>
</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> </up-empty>
<button @click="test2">叫我按钮</button>
</up-transition> </up-transition>
<!-- 报价记录 --> <!-- 报价记录 -->
<up-transition :show="showGoods2" mode="slide-right"> <up-transition :show="showGoods2" mode="slide-right">
@ -138,6 +139,12 @@
OpurchaseGoodsOfferListApi OpurchaseGoodsOfferListApi
} from "@/api/quotation.js" } from "@/api/quotation.js"
const test2 = () => {
console.log("点解")
uni.navigateTo({
url: '/pages/index/index'
})
}
// url // url
const successPng = ref('https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/739c3202405071458553459.png') 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') const errPng = ref('https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/04c2c202405071501462462.png')

View File

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

View File

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