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

@ -23,13 +23,15 @@
<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"
placeholder="请输入购买重量" inputAlign="right"></up-input>
</view> </view>
</view> </view>
<view v-else class="row"> <view v-else 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"
placeholder="请输入购买数量" inputAlign="right"></up-input>
</view> </view>
</view> </view>
<view class="row" style="padding-top: 30px;padding-bottom: 30rpx;"> <view class="row" style="padding-top: 30px;padding-bottom: 30rpx;">
@ -45,8 +47,13 @@
</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: {
@ -58,7 +65,7 @@ import { toast } from "../uni_modules/uview-plus";
const datas = ref({ const datas = ref({
cart_num: '' cart_num: ''
}); });
const setData = (e)=>{ const setData = (e) => {
datas.value = e; datas.value = e;
} }
@ -68,15 +75,15 @@ import { toast } from "../uni_modules/uview-plus";
} }
const change = () => { const change = () => {
if(subtotal.value<=0) { if (subtotal.value <= 0) {
uni.$u.toast('金额不可小于等于0'); uni.$u.toast('金额不可小于等于0');
datas.value.cart_num = ''; datas.value.cart_num = '';
return ; return;
} }
emit('change', datas.value); emit('change', datas.value);
} }
const subtotal = computed(()=>{ const subtotal = computed(() => {
let num = +datas.value.cart_num || 0; let num = +datas.value.cart_num || 0;
let sell = +datas.value.sell; let sell = +datas.value.sell;
return Math.ceil(num * sell * 100) / 100 return Math.ceil(num * sell * 100) / 100

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);