zhaogongxue 7 months ago
parent
commit
1c8035bc8c

+ 235 - 200
pageD/evaluate/evaluate.vue

@@ -1,214 +1,249 @@
 <template>
-  <view>
-    <view class="content" v-for="item in orderDetail.goods">
-      <view class="goods-title">
-        <image class="goods-img" :src="item.goods_image" mode="scaleToFill" />
-        <view class="title"> {{ item.goods_name }} </view>
-      </view>
-      <view class="rate">
-        <view class="_label"> 商品评价 </view>
-        <u-rate :count="count" v-model="value" size="22"></u-rate>
-      </view>
+	<view>
+		<view class="content" v-for="(item,idx) in orderDetail.goods" :key="idx">
+			<view class="goods-title">
+				<image class="goods-img" :src="item.goods_image" mode="scaleToFill" />
+				<view class="title"> {{ item.goods_name }} </view>
+			</view>
+			<view class="rate">
+				<view class="_label"> 商品评价 </view>
+				<u-rate :count="count" v-model="value" size="22"></u-rate>
+			</view>
+			<view class="">{{item.list}}</view>
 
-      <!-- accept="all" 可以上传视频是配置该字段 -->
+			<!-- accept="all" 可以上传视频是配置该字段 -->
 
-      <u-upload
-        :fileList="fileList1"
-        @afterRead="afterRead"
-        @delete="deletePic"
-        name="1"
-        multiple
-        :maxCount="10"
-      >
-        <view class="upload-photo">
-          <u-icon name="camera" size="26"></u-icon>
-          <text>添加图片/视频</text>
-        </view>
-      </u-upload>
-      <view class="_text">
-        <u--textarea
-          border="none"
-          v-model="value1"
-          height="150"
-          placeholder="展开说说对商品的想法"
-        ></u--textarea>
-      </view>
-    </view>
-    <button class="btn-1" @click="submit">提交评价</button>
-  </view>
+			<!-- 			<u-upload :fileList="item.list" @afterRead="afterRead" @delete="deletePic" :name="idx" multiple
+				:maxCount="10"> -->
+			<u-upload :fileList="fileList0" @afterRead="afterRead" @delete="deletePic" name="0" multiple :maxCount="10">
+				<view class="upload-photo">
+					<u-icon name="camera" size="26"></u-icon>
+					<text>添加图片/视频</text>
+				</view>
+			</u-upload>
+			<view class="_text">
+				<u--textarea border="none" v-model="value1" height="150" placeholder="展开说说对商品的想法"></u--textarea>
+			</view>
+		</view>
+		<button class="btn-1" @click="submit">提交评价</button>
+	</view>
 </template>
 
 <script>
-export default {
-  data() {
-    return {
-      count: 5,
-      value: 5,
-      value1: "",
-      fileList1: [],
-      status: "",
-      orderDetail: {},
-    };
-  },
-  onLoad(options) {
-    this.status = options.orderId;
-    this.getDetail();
-  },
-  methods: {
-    //提交评价
-    submit() {
-      let imgList = [];
-      this.fileList1.map((item) => {
-        imgList.push(item.thumb);
-      });
-      uni.$u.http
-        .post(`/api/order/comment`, {
-          order_goods_id: this.orderDetail.goods[0].id,
-          content: this.value1,
-          score: this.value,
-          image: imgList.join(","),
-          video: "",
-        })
-        .then((res) => {
-          uni.showToast({
-            title: "评价成功",
-            icon: "none",
-          });
-          let timer = setTimeout(() => {
-            uni.navigateBack({
-              delta: 1,
-            });
-            clearTimeout(timer);
-          }, 1000);
-        });
-    },
-    // 删除图片
-    deletePic(event) {
-      this[`fileList${event.name}`].splice(event.index, 1);
-    },
-    // 新增图片
-    async afterRead(event) {
-      console.log(event);
-      // 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
-      let lists = [].concat(event.file);
-      let fileListLen = this[`fileList${event.name}`].length;
-      lists.map((item) => {
-        this[`fileList${event.name}`].push({
-          ...item,
-          // status: "uploading",
-          // message: "上传中",
-        });
-      });
-      for (let i = 0; i < lists.length; i++) {
-        const result = await this.uploadFilePromise(lists[i].url);
-        let item = this[`fileList${event.name}`][fileListLen];
-        this[`fileList${event.name}`].splice(
-          fileListLen,
-          1,
-          Object.assign(item, {
-            status: "success",
-            message: "",
-            url: result,
-          })
-        );
-        fileListLen++;
-      }
-    },
-    uploadFilePromise(url) {
-      return new Promise((resolve, reject) => {
-        let a = uni.uploadFile({
-          url: `${uni.$u.http.config.baseURL}/api/upload/images`, // 仅为示例,非真实的接口地址
-          filePath: url,
-          name: "file",
-          formData: {
-            user: "test",
-          },
-          success: (res) => {
-            setTimeout(() => {
-              resolve(res.data.data);
-            }, 1000);
-          },
-        });
-      });
-    },
-    getDetail() {
-      uni.$u.http.get(`/api/order/read?id=${this.status}`).then((res) => {
-        this.orderDetail = res;
-      });
-    },
-  },
-  mounted() {
-    uni.setNavigationBarTitle({
-      title: "评价",
-    });
-  },
-};
+	import list from '../../uview-ui/libs/config/props/list';
+	export default {
+		data() {
+			return {
+				count: 5,
+				value: 5,
+				value1: "",
+				status: "",
+				orderDetail: {},
+				fileList0: []
+			};
+		},
+		onLoad(options) {
+			this.status = options.orderId;
+			this.getDetail();
+		},
+		methods: {
+			//提交评价
+			submit() {
+				let imgList = [];
+				this.fileList1.map((item) => {
+					imgList.push(item.thumb);
+				});
+				uni.$u.http
+					.post(`/api/order/comment`, {
+						order_goods_id: this.orderDetail.goods[0].id,
+						content: this.value1,
+						score: this.value,
+						image: imgList.join(","),
+						video: "",
+					})
+					.then((res) => {
+						uni.showToast({
+							title: "评价成功",
+							icon: "none",
+						});
+						let timer = setTimeout(() => {
+							uni.navigateBack({
+								delta: 1,
+							});
+							clearTimeout(timer);
+						}, 1000);
+					});
+			},
+			// 删除图片
+			// deletePic(event) {
+			// 	this[`fileList${event.name}`].splice(event.index, 1);
+			// },
+			deletePic(event) {
+				this.orderDetail.goods[event.name].list.splice(event.index, 1);
+			},
+			// async afterRead(event) {
+			// 	console.log(event);
+			// 	let lists = [].concat(event.file);
+			// 	let imglist = this.orderDetail.goods[event.name].list
+			// 	let fileListLen = this.orderDetail.goods[event.name].list.length;
+			// 	// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
+			// 	lists.map((item) => {
+			// 		this.orderDetail.goods[event.name].list.push({
+			// 			...item,
+			// 			status: "uploading",
+			// 			message: "上传中",
+			// 		});
+			// 	});
+			// 	console.log('list1', this.orderDetail.goods[event.name].list);
+			// 	for (let i = 0; i < lists.length; i++) {
+			// 		const result = await this.uploadFilePromise(this.orderDetail.goods[event.name].list[i].url);
+			// 		let item = this.orderDetail.goods[event.name].list[fileListLen];
+			// 		this.orderDetail.goods[event.name].list.splice(
+			// 			fileListLen,
+			// 			1,
+			// 			Object.assign(item, {
+			// 				status: "success",
+			// 				message: "",
+			// 				url: result,
+			// 			})
+			// 		);
+			// 		fileListLen++;
+			// 	}
+			// 	console.log('list2', this.orderDetail.goods[event.name].list);
+			// },
+			// 新增图片
+			async afterRead(event) {
+				console.log(event);
+				// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
+				let lists = [].concat(event.file);
+				let fileListLen = this[`fileList${event.name}`].length;
+				lists.map((item) => {
+					this[`fileList${event.name}`].push({
+						...item,
+					});
+				});
+				console.log('list', this[`fileList${event.name}`]);
+				for (let i = 0; i < lists.length; i++) {
+					const result = await this.uploadFilePromise(lists[i].url);
+					console.log(result);
+					let item = this[`fileList${event.name}`][fileListLen];
+					this[`fileList${event.name}`].splice(
+						fileListLen,
+						1,
+						Object.assign(item, {
+							status: "success",
+							message: "",
+							url: result,
+						})
+					);
+					fileListLen++;
+					console.log('list', this[`fileList${event.name}`]);
+				}
+			},
+			uploadFilePromise(url) {
+				return new Promise((resolve, reject) => {
+					let a = uni.uploadFile({
+						url: `${uni.$u.http.config.baseURL}/api/upload/images`, // 仅为示例,非真实的接口地址
+						filePath: url,
+						name: "file",
+						formData: {
+							user: "test",
+						},
+						success: (res) => {
+							setTimeout(() => {
+								// resolve(JSON.parse(res.data).data.filePath);
+								resolve(res.data.data);
+							}, 1000);
+						},
+					});
+				});
+			},
+			getDetail() {
+				uni.$u.http.get(`/api/order/read?id=${this.status}`).then((res) => {
+					this.orderDetail = res;
+					this.orderDetail.goods.forEach((item) => {
+						item.list = []
+					})
+					console.log(this.orderDetail);
+				});
+			},
+		},
+		mounted() {
+			uni.setNavigationBarTitle({
+				title: "评价",
+			});
+		},
+	};
 </script>
 
 <style lang="scss" scoped>
-.content {
-  background-color: #fff;
-  padding: 40rpx 24rpx;
-  .goods-title {
-    display: flex;
-    justify-content: flex-start;
-    align-items: center;
-    .goods-img {
-      width: 52rpx;
-      height: 52rpx;
-      border-radius: 6rpx;
-    }
-    .title {
-      font-size: 24rpx;
-      color: rgba(51, 51, 51, 0.5);
-      margin-left: 20rpx;
-    }
-  }
+	.content {
+		background-color: #fff;
+		padding: 40rpx 24rpx;
 
-  .rate {
-    display: flex;
-    align-items: center;
-    margin-bottom: 20rpx;
+		.goods-title {
+			display: flex;
+			justify-content: flex-start;
+			align-items: center;
 
-    ._label {
-      font-size: 32rpx;
-      font-weight: 600;
-      margin-right: 22rpx;
-    }
-  }
+			.goods-img {
+				width: 52rpx;
+				height: 52rpx;
+				border-radius: 6rpx;
+			}
 
-  ._text {
-    margin-top: 32rpx;
-    padding-top: 26rpx;
-    border-top: 2rpx solid rgba(151, 151, 151, 0.1);
-  }
+			.title {
+				font-size: 24rpx;
+				color: rgba(51, 51, 51, 0.5);
+				margin-left: 20rpx;
+			}
+		}
 
-  .upload-photo {
-    width: 180rpx;
-    height: 180rpx;
-    border: 2rpx dashed #979797;
-    border-radius: 8rpx;
-    display: flex;
-    align-items: center;
-    flex-direction: column;
-    justify-content: center;
-    font-size: 24rpx;
-    color: rgba(34, 34, 34, 0.8);
-  }
+		.rate {
+			display: flex;
+			align-items: center;
+			margin-bottom: 20rpx;
 
-  ::v-deep .u-textarea {
-    background-color: #fff;
-  }
-}
-.btn-1 {
-  background-color: #f83224;
-  color: #fff;
-  border-radius: 40rpx;
-  height: 80rpx;
-  line-height: 80rpx;
-  width: 90%;
-  margin: 0 auto;
-  margin-top: 70rpx;
-  font-size: 32rpx;
-}
-</style>
+			._label {
+				font-size: 32rpx;
+				font-weight: 600;
+				margin-right: 22rpx;
+			}
+		}
+
+		._text {
+			margin-top: 32rpx;
+			padding-top: 26rpx;
+			border-top: 2rpx solid rgba(151, 151, 151, 0.1);
+		}
+
+		.upload-photo {
+			width: 180rpx;
+			height: 180rpx;
+			border: 2rpx dashed #979797;
+			border-radius: 8rpx;
+			display: flex;
+			align-items: center;
+			flex-direction: column;
+			justify-content: center;
+			font-size: 24rpx;
+			color: rgba(34, 34, 34, 0.8);
+		}
+
+		::v-deep .u-textarea {
+			background-color: #fff;
+		}
+	}
+
+	.btn-1 {
+		background-color: #f83224;
+		color: #fff;
+		border-radius: 40rpx;
+		height: 80rpx;
+		line-height: 80rpx;
+		width: 90%;
+		margin: 0 auto;
+		margin-top: 70rpx;
+		font-size: 32rpx;
+	}
+</style>

File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/pageD/evaluate/evaluate.js.map


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/common/vendor.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/pageA/chat/chat.wxml


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/pageA/chat/news.wxml


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/pageA/productdetails.wxml


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/pageA/service/service.wxml


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/pageB/ParcelExpress.wxml


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/pageB/account.wxml


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/pageB/end.wxml


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/pageB/goods.wxml


+ 1 - 1
unpackage/dist/dev/mp-weixin/pageB/search.wxml

@@ -1 +1 @@
-<view class="back data-v-4bad5c32"><view class="u-flex u-row-between data-v-4bad5c32"><view style="width:622rpx;" class="data-v-4bad5c32"><u-search vue-id="29feab14-1" placeholder="{{i18n.Please}}" showAction="{{false}}" value="{{keyword}}" data-event-opts="{{[['^focus',[['focus']]],['^input',[['__set_model',['','keyword','$event',[]]]]]]}}" bind:focus="__e" bind:input="__e" class="data-v-4bad5c32" bind:__l="__l"></u-search></view><block wx:if="{{keyword==''}}"><text data-event-opts="{{[['tap',[['clear',['$event']]]]]}}" bindtap="__e" class="data-v-4bad5c32">{{i18n.Cancel}}</text></block><block wx:else><text data-event-opts="{{[['tap',[['enter',['$event']]]]]}}" bindtap="__e" class="data-v-4bad5c32">{{i18n.enter}}</text></block></view><block wx:if="{{blurshow==false&&keyword==''}}"><view class="title data-v-4bad5c32" style="margin-top:32rpx;">{{''+i18n.Popularshipment+''}}</view></block><block wx:if="{{blurshow==false&&keyword==''}}"><view class="u-flex data-v-4bad5c32" style="column-gap:20rpx;flex-wrap:wrap;"><block wx:for="{{record}}" wx:for-item="item" wx:for-index="idx" wx:key="idx"><view data-event-opts="{{[['tap',[['select',['$0'],[[['record','',idx]]]]]]]}}" class="tabs data-v-4bad5c32" bindtap="__e">{{''+item+''}}</view></block></view></block><block wx:if="{{blurshow}}"><scroll-view scroll-y="{{true}}" class="data-v-4bad5c32"><block wx:for="{{goods}}" wx:for-item="item" wx:for-index="index"><view data-event-opts="{{[['tap',[['changeitem',['$0'],[[['goods','',index]]]]]]]}}" class="searchitem data-v-4bad5c32" bindtap="__e"><block wx:if="{{language=='zh-CN'}}"><text class="data-v-4bad5c32">{{item.name_cn}}</text></block><block wx:if="{{language=='en-US'}}"><text class="data-v-4bad5c32">{{item.name_en}}</text></block><block wx:if="{{language=='es-ES'}}"><text class="data-v-4bad5c32">{{item.name_es}}</text></block><block wx:if="{{language=='it-IT'}}"><text class="data-v-4bad5c32">{{item.name_ita}}</text></block></view></block></scroll-view></block></view>
+<view class="back data-v-4bad5c32"><view class="u-flex u-row-between data-v-4bad5c32"><view style="width:622rpx;" class="data-v-4bad5c32"><u-search vue-id="29feab14-1" placeholder="{{i18n.Please}}" showAction="{{false}}" value="{{keyword}}" data-event-opts="{{[['^focus',[['focus']]],['^input',[['__set_model',['','keyword','$event',[]]]]]]}}" bind:focus="__e" bind:input="__e" class="data-v-4bad5c32" bind:__l="__l"></u-search></view><block wx:if="{{keyword==''}}"><text data-event-opts="{{[['tap',[['clear',['$event']]]]]}}" bindtap="__e" class="data-v-4bad5c32">{{i18n.Cancel}}</text></block><block wx:else><text data-event-opts="{{[['tap',[['enter',['$event']]]]]}}" bindtap="__e" class="data-v-4bad5c32">{{i18n.enter}}</text></block></view><block wx:if="{{blurshow==false&&keyword==''}}"><view class="title data-v-4bad5c32" style="margin-top:32rpx;">{{''+i18n.Popularshipment+''}}</view></block><block wx:if="{{blurshow==false&&keyword==''}}"><view class="u-flex  data-v-4bad5c32" style="column-gap:20rpx;flex-wrap:wrap;"><block wx:for="{{record}}" wx:for-item="item" wx:for-index="idx" wx:key="idx"><view data-event-opts="{{[['tap',[['select',['$0'],[[['record','',idx]]]]]]]}}" class="tabs data-v-4bad5c32" bindtap="__e">{{''+item+''}}</view></block></view></block><block wx:if="{{blurshow}}"><scroll-view scroll-y="{{true}}" class="data-v-4bad5c32"><block wx:for="{{goods}}" wx:for-item="item" wx:for-index="index"><view data-event-opts="{{[['tap',[['changeitem',['$0'],[[['goods','',index]]]]]]]}}" class="searchitem data-v-4bad5c32" bindtap="__e"><block wx:if="{{language=='zh-CN'}}"><text class="data-v-4bad5c32">{{item.name_cn}}</text></block><block wx:if="{{language=='en-US'}}"><text class="data-v-4bad5c32">{{item.name_en}}</text></block><block wx:if="{{language=='es-ES'}}"><text class="data-v-4bad5c32">{{item.name_es}}</text></block><block wx:if="{{language=='it-IT'}}"><text class="data-v-4bad5c32">{{item.name_ita}}</text></block></view></block></scroll-view></block></view>

File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/pageD/evaluate/evaluate.js


+ 1 - 1
unpackage/dist/dev/mp-weixin/pageD/evaluate/evaluate.wxml

@@ -1 +1 @@
-<view class="data-v-fa248092"><block wx:for="{{orderDetail.goods}}" wx:for-item="item" wx:for-index="__i0__"><view class="content data-v-fa248092"><view class="goods-title data-v-fa248092"><image class="goods-img data-v-fa248092" src="{{item.goods_image}}" mode="scaleToFill"></image><view class="title data-v-fa248092">{{''+item.goods_name+''}}</view></view><view class="rate data-v-fa248092"><view class="_label data-v-fa248092">商品评价</view><u-rate bind:input="__e" vue-id="{{'4a6a8fa2-1-'+__i0__}}" count="{{count}}" size="22" value="{{value}}" data-event-opts="{{[['^input',[['__set_model',['','value','$event',[]]]]]]}}" class="data-v-fa248092" bind:__l="__l"></u-rate></view><u-upload vue-id="{{'4a6a8fa2-2-'+__i0__}}" fileList="{{fileList1}}" name="1" multiple="{{true}}" maxCount="{{10}}" data-event-opts="{{[['^afterRead',[['afterRead']]],['^delete',[['deletePic']]]]}}" bind:afterRead="__e" bind:delete="__e" class="data-v-fa248092" bind:__l="__l" vue-slots="{{['default']}}"><view class="upload-photo data-v-fa248092"><u-icon vue-id="{{('4a6a8fa2-3-'+__i0__)+','+('4a6a8fa2-2-'+__i0__)}}" name="camera" size="26" class="data-v-fa248092" bind:__l="__l"></u-icon><text class="data-v-fa248092">添加图片/视频</text></view></u-upload><view class="_text data-v-fa248092"><u--textarea bind:input="__e" vue-id="{{'4a6a8fa2-4-'+__i0__}}" border="none" height="150" placeholder="展开说说对商品的想法" value="{{value1}}" data-event-opts="{{[['^input',[['__set_model',['','value1','$event',[]]]]]]}}" class="data-v-fa248092" bind:__l="__l"></u--textarea></view></view></block><button data-event-opts="{{[['tap',[['submit',['$event']]]]]}}" class="btn-1 data-v-fa248092" bindtap="__e">提交评价</button></view>
+<view class="data-v-fa248092"><block wx:for="{{orderDetail.goods}}" wx:for-item="item" wx:for-index="idx" wx:key="idx"><view class="content data-v-fa248092"><view class="goods-title data-v-fa248092"><image class="goods-img data-v-fa248092" src="{{item.goods_image}}" mode="scaleToFill"></image><view class="title data-v-fa248092">{{''+item.goods_name+''}}</view></view><view class="rate data-v-fa248092"><view class="_label data-v-fa248092">商品评价</view><u-rate bind:input="__e" vue-id="{{'4a6a8fa2-1-'+idx}}" count="{{count}}" size="22" value="{{value}}" data-event-opts="{{[['^input',[['__set_model',['','value','$event',[]]]]]]}}" class="data-v-fa248092" bind:__l="__l"></u-rate></view><view class="data-v-fa248092">{{item.list}}</view><u-upload vue-id="{{'4a6a8fa2-2-'+idx}}" fileList="{{fileList0}}" name="0" multiple="{{true}}" maxCount="{{10}}" data-event-opts="{{[['^afterRead',[['afterRead']]],['^delete',[['deletePic']]]]}}" bind:afterRead="__e" bind:delete="__e" class="data-v-fa248092" bind:__l="__l" vue-slots="{{['default']}}"><view class="upload-photo data-v-fa248092"><u-icon vue-id="{{('4a6a8fa2-3-'+idx)+','+('4a6a8fa2-2-'+idx)}}" name="camera" size="26" class="data-v-fa248092" bind:__l="__l"></u-icon><text class="data-v-fa248092">添加图片/视频</text></view></u-upload><view class="_text data-v-fa248092"><u--textarea bind:input="__e" vue-id="{{'4a6a8fa2-4-'+idx}}" border="none" height="150" placeholder="展开说说对商品的想法" value="{{value1}}" data-event-opts="{{[['^input',[['__set_model',['','value1','$event',[]]]]]]}}" class="data-v-fa248092" bind:__l="__l"></u--textarea></view></view></block><button data-event-opts="{{[['tap',[['submit',['$event']]]]]}}" class="btn-1 data-v-fa248092" bindtap="__e">提交评价</button></view>

+ 14 - 0
unpackage/dist/dev/mp-weixin/project.private.config.json

@@ -30,6 +30,20 @@
           "query": "package=2",
           "launchMode": "default",
           "scene": null
+        },
+        {
+          "name": "",
+          "pathName": "pageC/addEditAddress/addEditAddress",
+          "query": "",
+          "launchMode": "default",
+          "scene": null
+        },
+        {
+          "name": "",
+          "pathName": "pageD/evaluate/evaluate",
+          "query": "orderId=428",
+          "launchMode": "default",
+          "scene": null
         }
       ]
     }

+ 2 - 2
unpackage/dist/dev/mp-weixin/uni_modules/lime-painter/components/l-painter/l-painter.json

@@ -1,4 +1,4 @@
 {
-  "component": true,
-  "usingComponents": {}
+  "usingComponents": {},
+  "component": true
 }

Some files were not shown because too many files changed in this diff