|
@@ -21,17 +21,9 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="upload">
|
|
<view class="upload">
|
|
|
- <u-upload
|
|
|
|
|
- class="upliado_cusstom"
|
|
|
|
|
- :action="action"
|
|
|
|
|
- :file-list="fileList"
|
|
|
|
|
- @on-success="onUploadSuccess"
|
|
|
|
|
- @on-remove="onRemove"
|
|
|
|
|
- @on-choose-complete="onChooseComplete"
|
|
|
|
|
- :max-count="9"
|
|
|
|
|
- :multiple="true"
|
|
|
|
|
- :auto-upload="true"
|
|
|
|
|
- ></u-upload>
|
|
|
|
|
|
|
+ <u-upload class="upliado_cusstom" :action="action" :file-list="fileList" @on-success="onUploadSuccess"
|
|
|
|
|
+ @on-remove="onRemove" @on-choose-complete="onChooseComplete" :max-count="9" :multiple="true"
|
|
|
|
|
+ :auto-upload="true"></u-upload>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="foot">
|
|
<view class="foot">
|
|
@@ -43,220 +35,217 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
- import configService from '../../common/service/config.service'
|
|
|
|
|
- export default {
|
|
|
|
|
- data() {
|
|
|
|
|
- return {
|
|
|
|
|
- action: configService.apiUrl + '/sys/common/upload',
|
|
|
|
|
- imageHttp: configService.apiUrl + '/',
|
|
|
|
|
- fileList: [],
|
|
|
|
|
- uploadedFiles: [],
|
|
|
|
|
- taskId :'',
|
|
|
|
|
- checkType :'',
|
|
|
|
|
- uptype:'',
|
|
|
|
|
- paramState :'',
|
|
|
|
|
- serveType :'',
|
|
|
|
|
- jumptype:null
|
|
|
|
|
|
|
+import configService from '../../common/service/config.service'
|
|
|
|
|
+export default {
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ action: configService.apiUrl + '/sys/common/upload',
|
|
|
|
|
+ imageHttp: configService.apiUrl + '/',
|
|
|
|
|
+ fileList: [],
|
|
|
|
|
+ uploadedFiles: [],
|
|
|
|
|
+ taskId: '',
|
|
|
|
|
+ checkType: '',
|
|
|
|
|
+ uptype: '',
|
|
|
|
|
+ paramState: '',
|
|
|
|
|
+ serveType: '',
|
|
|
|
|
+ jumptype: null
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ onLoad(options) {
|
|
|
|
|
+ this.taskId = options.taskId;
|
|
|
|
|
+ this.checkType = options.checkType;
|
|
|
|
|
+ this.uptype = options.uptype;
|
|
|
|
|
+ this.paramState = options.paramState;
|
|
|
|
|
+ this.serveType = options.serveType;
|
|
|
|
|
+ this.jumptype = options.jumptype
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ back() {
|
|
|
|
|
+ if (this.jumptype == 0) {
|
|
|
|
|
+ uni.switchTab({
|
|
|
|
|
+ url: '/pages/order/index'
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ uni.navigateBack({
|
|
|
|
|
+ delta: 1
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- methods: {
|
|
|
|
|
- back() {
|
|
|
|
|
- console.log(this.jumptype)
|
|
|
|
|
- // uni.navigateBack();
|
|
|
|
|
- if(this.jumptype == 0){
|
|
|
|
|
- uni.switchTab({
|
|
|
|
|
- url:'/pages/order/index'
|
|
|
|
|
- })
|
|
|
|
|
- }else{
|
|
|
|
|
- uni.navigateBack();
|
|
|
|
|
|
|
+ // 上传成功回调
|
|
|
|
|
+ onUploadSuccess(res, index, lists) {
|
|
|
|
|
+ if (res.code === 0) {
|
|
|
|
|
+ this.uploadedFiles.push({
|
|
|
|
|
+ url: this.imageHttp + res.message,
|
|
|
|
|
+ response: res
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '上传失败: ' + res.message,
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ // 删除文件回调
|
|
|
|
|
+ onRemove(index, lists) {
|
|
|
|
|
+ this.uploadedFiles.splice(index, 1);
|
|
|
|
|
+ },
|
|
|
|
|
+ // 选择图片完成回调
|
|
|
|
|
+ onChooseComplete(lists) {
|
|
|
|
|
+ this.fileList = lists;
|
|
|
|
|
+ },
|
|
|
|
|
+ // 提交
|
|
|
|
|
+ submit() {
|
|
|
|
|
+ console.log(this.uploadedFiles)
|
|
|
|
|
+ if (this.uploadedFiles.length < 3) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '请至少上传3张照片',
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ // 所有图片都有内容,处理数据并发送请求
|
|
|
|
|
+ let temp = []
|
|
|
|
|
+ this.uploadedFiles.forEach(item => {
|
|
|
|
|
+ temp.push({
|
|
|
|
|
+ merchantId: uni.getStorageSync('login_user_info').merchantId,
|
|
|
|
|
+ merchantName: uni.getStorageSync('login_user_info').merchantName,
|
|
|
|
|
+ merchantUserId: uni.getStorageSync('login_user_info').id,
|
|
|
|
|
+ businessType: this.uptype,
|
|
|
|
|
+ taskId: this.taskId,
|
|
|
|
|
+ imgUrl: this.imageHttp + item.response.message
|
|
|
|
|
+ })
|
|
|
|
|
+ });
|
|
|
|
|
+ console.log(temp)
|
|
|
|
|
+ this.$http.post("/ts/merchant/addImg", temp).then(res => {
|
|
|
|
|
+ console.log(res);
|
|
|
|
|
+ if (res.data.code == 200) {
|
|
|
|
|
+ this.upSuccess()
|
|
|
}
|
|
}
|
|
|
- },
|
|
|
|
|
- // 上传成功回调
|
|
|
|
|
- onUploadSuccess(res, index, lists) {
|
|
|
|
|
- if (res.code === 0) {
|
|
|
|
|
- this.uploadedFiles.push({
|
|
|
|
|
- url: this.imageHttp + res.message,
|
|
|
|
|
- response: res
|
|
|
|
|
- });
|
|
|
|
|
- } else {
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ upSuccess() {
|
|
|
|
|
+ let data = {
|
|
|
|
|
+ taskId: this.taskId,
|
|
|
|
|
+ checkType: this.checkType,
|
|
|
|
|
+ paramState: this.paramState, //商户上传图片成功
|
|
|
|
|
+ serveType: this.serveType
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log(data)
|
|
|
|
|
+ this.$http.post("/ts/merchant/update/Serve", data).then(res => {
|
|
|
|
|
+ if (res.data.code == 200) {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
- title: '上传失败: ' + res.message,
|
|
|
|
|
- icon: 'none'
|
|
|
|
|
|
|
+ icon: 'none',
|
|
|
|
|
+ title: '上传成功'
|
|
|
});
|
|
});
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- // 删除文件回调
|
|
|
|
|
- onRemove(index, lists) {
|
|
|
|
|
- this.uploadedFiles.splice(index, 1);
|
|
|
|
|
- },
|
|
|
|
|
- // 选择图片完成回调
|
|
|
|
|
- onChooseComplete(lists) {
|
|
|
|
|
- this.fileList = lists;
|
|
|
|
|
- },
|
|
|
|
|
- // 提交
|
|
|
|
|
- submit() {
|
|
|
|
|
- console.log(this.uploadedFiles)
|
|
|
|
|
- if (this.uploadedFiles.length < 3) {
|
|
|
|
|
|
|
+ // uni.switchTab({
|
|
|
|
|
+ // url:'/pages/order/index'
|
|
|
|
|
+ // })
|
|
|
|
|
+ this.back()
|
|
|
|
|
+ } else {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
- title: '请至少上传3张照片',
|
|
|
|
|
- icon: 'none'
|
|
|
|
|
- });
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 所有图片都有内容,处理数据并发送请求
|
|
|
|
|
- let temp = []
|
|
|
|
|
- this.uploadedFiles.forEach(item => {
|
|
|
|
|
-
|
|
|
|
|
- temp.push({
|
|
|
|
|
- merchantId :uni.getStorageSync('login_user_info').merchantId,
|
|
|
|
|
- merchantName: uni.getStorageSync('login_user_info').merchantName,
|
|
|
|
|
- merchantUserId: uni.getStorageSync('login_user_info').id,
|
|
|
|
|
- businessType: this.uptype,
|
|
|
|
|
- taskId : this.taskId,
|
|
|
|
|
- imgUrl:this.imageHttp + item.response.message
|
|
|
|
|
- })
|
|
|
|
|
- });
|
|
|
|
|
- console.log(temp)
|
|
|
|
|
-
|
|
|
|
|
- this.$http.post("/ts/merchant/addImg", temp).then(res => {
|
|
|
|
|
- console.log(res);
|
|
|
|
|
- if (res.data.code == 200) {
|
|
|
|
|
-
|
|
|
|
|
- //
|
|
|
|
|
- this.upSuccess()
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- upSuccess() {
|
|
|
|
|
- let data = {
|
|
|
|
|
- taskId: this.taskId,
|
|
|
|
|
- checkType: this.checkType,
|
|
|
|
|
- paramState: this.paramState, //商户上传图片成功
|
|
|
|
|
- serveType: this.serveType
|
|
|
|
|
|
|
+ icon: 'none',
|
|
|
|
|
+ title: res.data.message
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
- console.log(data)
|
|
|
|
|
- this.$http.post("/ts/merchant/update/Serve", data).then(res => {
|
|
|
|
|
- if (res.data.code == 200) {
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- icon: 'none',
|
|
|
|
|
- title: '上传成功'
|
|
|
|
|
- });
|
|
|
|
|
- // uni.switchTab({
|
|
|
|
|
- // url:'/pages/order/index'
|
|
|
|
|
- // })
|
|
|
|
|
- this.back()
|
|
|
|
|
- } else {
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- icon: 'none',
|
|
|
|
|
- title: res.data.message
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
- onLoad(options) {
|
|
|
|
|
- this.taskId = options.taskId;
|
|
|
|
|
- this.checkType = options.checkType;
|
|
|
|
|
- this.uptype = options.uptype;
|
|
|
|
|
- this.paramState = options.paramState;
|
|
|
|
|
- this.serveType = options.serveType;
|
|
|
|
|
- this.jumptype = options.jumptype
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
|
- .arrive_upload {
|
|
|
|
|
- width: 100vw;
|
|
|
|
|
- height: 100vh;
|
|
|
|
|
|
|
+.arrive_upload {
|
|
|
|
|
+ width: 100vw;
|
|
|
|
|
+ height: 100vh;
|
|
|
|
|
+ background: #ffffff;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+
|
|
|
|
|
+ /*#ifdef APP-PLUS*/
|
|
|
|
|
+ .top {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: var(--status-bar-height);
|
|
|
background: #ffffff;
|
|
background: #ffffff;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /*#endif*/
|
|
|
|
|
+ .head {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 112rpx;
|
|
|
|
|
+ padding: 20rpx;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
- flex-direction: column;
|
|
|
|
|
- overflow: hidden;
|
|
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ background: #ffffff;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
|
|
|
- /*#ifdef APP-PLUS*/
|
|
|
|
|
- .top {
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- height: var(--status-bar-height);
|
|
|
|
|
- background: #ffffff;
|
|
|
|
|
|
|
+ .cuIcon-back {
|
|
|
|
|
+ font-size: 40rpx;
|
|
|
|
|
+ margin-right: 40rpx;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /*#endif*/
|
|
|
|
|
- .head {
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- height: 112rpx;
|
|
|
|
|
- padding: 20rpx;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- background: #ffffff;
|
|
|
|
|
- position: relative;
|
|
|
|
|
|
|
+ .case {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ left: 50%;
|
|
|
|
|
+ transform: translateX(-50%);
|
|
|
|
|
+ font-size: 36rpx;
|
|
|
|
|
+ // font-weight: 600;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- .cuIcon-back {
|
|
|
|
|
- font-size: 40rpx;
|
|
|
|
|
- margin-right: 40rpx;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ .center {
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ border-top: 1px solid #EEEEEE;
|
|
|
|
|
+ border-bottom: 1px solid #EEEEEE;
|
|
|
|
|
+ padding: 20rpx 28rpx;
|
|
|
|
|
+ overflow-y: auto;
|
|
|
|
|
|
|
|
- .case {
|
|
|
|
|
- position: absolute;
|
|
|
|
|
- left: 50%;
|
|
|
|
|
- transform: translateX(-50%);
|
|
|
|
|
|
|
+ .text {
|
|
|
|
|
+ .title {
|
|
|
font-size: 36rpx;
|
|
font-size: 36rpx;
|
|
|
- // font-weight: 600;
|
|
|
|
|
|
|
+ color: #333333;
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .center {
|
|
|
|
|
- flex: 1;
|
|
|
|
|
- border-top: 1px solid #EEEEEE;
|
|
|
|
|
- border-bottom: 1px solid #EEEEEE;
|
|
|
|
|
- padding: 20rpx 28rpx;
|
|
|
|
|
- overflow-y: auto;
|
|
|
|
|
-
|
|
|
|
|
- .text {
|
|
|
|
|
- .title {
|
|
|
|
|
- font-size: 36rpx;
|
|
|
|
|
- color: #333333;
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
- .describe {
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- background: #F6F8FA;
|
|
|
|
|
- padding: 20rpx;
|
|
|
|
|
- font-size: 24rpx;
|
|
|
|
|
- color: #909296;
|
|
|
|
|
- margin-top: 16rpx;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .upload {
|
|
|
|
|
- margin-top: 30rpx;
|
|
|
|
|
|
|
+ .describe {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ background: #F6F8FA;
|
|
|
|
|
+ padding: 20rpx;
|
|
|
|
|
+ font-size: 24rpx;
|
|
|
|
|
+ color: #909296;
|
|
|
|
|
+ margin-top: 16rpx;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- .foot {
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- height: 112rpx;
|
|
|
|
|
- padding: 16rpx 24rpx;
|
|
|
|
|
-
|
|
|
|
|
- .btn {
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- height: 76rpx;
|
|
|
|
|
- background: #449AFF;
|
|
|
|
|
- border-radius: 66rpx;
|
|
|
|
|
- text-align: center;
|
|
|
|
|
- line-height: 76rpx;
|
|
|
|
|
- color: #ffffff;
|
|
|
|
|
- font-size: 28rpx;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ .upload {
|
|
|
|
|
+ margin-top: 30rpx;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- ::v-deep .u-add-wrap {
|
|
|
|
|
- width: 320rpx !important;
|
|
|
|
|
- height: 194rpx !important;
|
|
|
|
|
- }
|
|
|
|
|
- ::v-deep .u-preview-wrap{
|
|
|
|
|
- width: 320rpx !important;
|
|
|
|
|
- height: 194rpx !important;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ .foot {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 112rpx;
|
|
|
|
|
+ padding: 16rpx 24rpx;
|
|
|
|
|
+
|
|
|
|
|
+ .btn {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 76rpx;
|
|
|
|
|
+ background: #449AFF;
|
|
|
|
|
+ border-radius: 66rpx;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ line-height: 76rpx;
|
|
|
|
|
+ color: #ffffff;
|
|
|
|
|
+ font-size: 28rpx;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+::v-deep .u-add-wrap {
|
|
|
|
|
+ width: 320rpx !important;
|
|
|
|
|
+ height: 194rpx !important;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+::v-deep .u-preview-wrap {
|
|
|
|
|
+ width: 320rpx !important;
|
|
|
|
|
+ height: 194rpx !important;
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|