chenkainan 11 months ago
parent
commit
e63fb018cb
  1. 56
      components/scanCode.vue
  2. 173
      package-lock.json
  3. 20
      package.json
  4. 10
      pages.json
  5. 64
      pages/verification/index.vue
  6. 2
      static/js/CommonFunction.js
  7. 470
      subPackages/user/infoFilling.vue
  8. 237
      subPackages/user/register.vue
  9. 569
      subPackages/user/userInfo.vue
  10. 41
      subPackages/video/index.vue

56
components/scanCode.vue

@ -0,0 +1,56 @@
<template>
<view>
<text>{{ result }}</text>
<qrcode-stream @decode="onDecode" @init="initQR" />
</view>
</template>
<script>
//
import { QrcodeStream } from "vue-qrcode-reader";
export default {
name: "scanCodeVue",
data() {
return {
result: '', //
error: '',
}
},
components: {QrcodeStream},
methods: {
onDecode(result) {
this.result = result;
_this.$emit("success", result)
},
async initQR(promise) {
let _this = this
const { capabilities } = await promise;
const TORCH_IS_SUPPORTED = !!capabilities.torch;
try {
let res = await promise;
console.log(res)
} catch (error) {
if (error.name === "NotAllowedError") {
this.error = "ERROR: 您需要授予相机访问权限";
} else if (error.name === "NotFoundError") {
this.error = "ERROR: 这个设备上没有摄像头";
} else if (error.name === "NotSupportedError") {
this.error = "ERROR: 所需的安全上下文(HTTPS、本地主机)";
} else if (error.name === "NotReadableError") {
this.error = "ERROR: 相机被占用";
} else if (error.name === "OverconstrainedError") {
this.error = "ERROR: 安装摄像头不合适";
} else if (error.name === "StreamApiNotSupportedError") {
this.error = "ERROR: 此浏览器不支持流API";
} else {
this.error = '获取摄像头权限失败'
}
_this.$emit("fail", this.error)
}
},
},
}
</script>

173
package-lock.json

@ -1,11 +1,174 @@
{
"requires": true,
"name": "tourGuide",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"weixin-js-sdk": {
"version": "1.6.5",
"resolved": "https://registry.npmmirror.com/weixin-js-sdk/-/weixin-js-sdk-1.6.5.tgz",
"integrity": "sha512-Gph1WAWB2YN/lMOFB/ymb+hbU/wYazzJgu6PMMktCy9cSCeW5wA6Zwt0dpahJbJ+RJEwtTv2x9iIu0U4enuVSQ=="
"@babel/helper-string-parser": {
"version": "7.25.9",
"resolved": "https://registry.npmmirror.com/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz",
"integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA=="
},
"@babel/helper-validator-identifier": {
"version": "7.25.9",
"resolved": "https://registry.npmmirror.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz",
"integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ=="
},
"@babel/parser": {
"version": "7.26.2",
"resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.26.2.tgz",
"integrity": "sha512-DWMCZH9WA4Maitz2q21SRKHo9QXZxkDsbNZoVD62gusNtNBBqDg9i7uOhASfTfIGNzW+O+r7+jAlM8dwphcJKQ==",
"requires": {
"@babel/types": "^7.26.0"
}
},
"@babel/types": {
"version": "7.26.0",
"resolved": "https://registry.npmmirror.com/@babel/types/-/types-7.26.0.tgz",
"integrity": "sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==",
"requires": {
"@babel/helper-string-parser": "^7.25.9",
"@babel/helper-validator-identifier": "^7.25.9"
}
},
"@vue/compiler-sfc": {
"version": "2.7.16",
"resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-2.7.16.tgz",
"integrity": "sha512-KWhJ9k5nXuNtygPU7+t1rX6baZeqOYLEforUPjgNDBnLicfHCoi48H87Q8XyLZOrNNsmhuwKqtpDQWjEFe6Ekg==",
"requires": {
"@babel/parser": "^7.23.5",
"postcss": "^8.4.14",
"prettier": "^1.18.2 || ^2.0.0",
"source-map": "^0.6.1"
}
},
"@zxing/library": {
"version": "0.18.6",
"resolved": "https://registry.npmmirror.com/@zxing/library/-/library-0.18.6.tgz",
"integrity": "sha512-bulZ9JHoLFd9W36pi+7e7DnEYNJhljYjZ1UTsKPOoLMU3qtC+REHITeCRNx40zTRJZx18W5TBRXt5pq2Uopjsw==",
"requires": {
"@zxing/text-encoding": "~0.9.0",
"ts-custom-error": "^3.0.0"
}
},
"@zxing/text-encoding": {
"version": "0.9.0",
"resolved": "https://registry.npmmirror.com/@zxing/text-encoding/-/text-encoding-0.9.0.tgz",
"integrity": "sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA==",
"optional": true
},
"barcode-detector": {
"version": "0.5.0",
"resolved": "https://registry.npmmirror.com/barcode-detector/-/barcode-detector-0.5.0.tgz",
"integrity": "sha512-CL0ETCnLjaklGbFJeU1f5SU3CHVK1Tm+SjPbLKlt8iJ6Fqgc9yseNmWEpXSPmcGW3ET3rUwkWk2fXG+kcSbwBw==",
"requires": {
"@zxing/library": "^0.18.4",
"jsqr": "^1.3.1"
}
},
"callforth": {
"version": "0.3.1",
"resolved": "https://registry.npmmirror.com/callforth/-/callforth-0.3.1.tgz",
"integrity": "sha512-Q2zPfqnwoKsb1DTVCr4lmhe49wKNBsMmNlbudjleu3/co+Nw1pOqFHYJHrW3VZ253ou9AAr+xauQR0C55NPdzA=="
},
"core-js": {
"version": "3.39.0",
"resolved": "https://registry.npmmirror.com/core-js/-/core-js-3.39.0.tgz",
"integrity": "sha512-raM0ew0/jJUqkJ0E6e8UDtl+y/7ktFivgWvqw8dNSQeNWoSDLvQ1H/RN3aPXB9tBd4/FhyR4RDPGhsNIMsAn7g=="
},
"csstype": {
"version": "3.1.3",
"resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.1.3.tgz",
"integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="
},
"jsqr": {
"version": "1.4.0",
"resolved": "https://registry.npmmirror.com/jsqr/-/jsqr-1.4.0.tgz",
"integrity": "sha512-dxLob7q65Xg2DvstYkRpkYtmKm2sPJ9oFhrhmudT1dZvNFFTlroai3AWSpLey/w5vMcLBXRgOJsbXpdN9HzU/A=="
},
"nanoid": {
"version": "3.3.8",
"resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.8.tgz",
"integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w=="
},
"picocolors": {
"version": "1.1.1",
"resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.1.1.tgz",
"integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="
},
"postcss": {
"version": "8.4.49",
"resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.49.tgz",
"integrity": "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==",
"requires": {
"nanoid": "^3.3.7",
"picocolors": "^1.1.1",
"source-map-js": "^1.2.1"
}
},
"prettier": {
"version": "2.8.8",
"resolved": "https://registry.npmmirror.com/prettier/-/prettier-2.8.8.tgz",
"integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
"optional": true
},
"rtcpeerconnection-shim": {
"version": "1.2.15",
"resolved": "https://registry.npmmirror.com/rtcpeerconnection-shim/-/rtcpeerconnection-shim-1.2.15.tgz",
"integrity": "sha512-C6DxhXt7bssQ1nHb154lqeL0SXz5Dx4RczXZu2Aa/L1NJFnEVDxFwCBo3fqtuljhHIGceg5JKBV4XJ0gW5JKyw==",
"requires": {
"sdp": "^2.6.0"
}
},
"sdp": {
"version": "2.12.0",
"resolved": "https://registry.npmmirror.com/sdp/-/sdp-2.12.0.tgz",
"integrity": "sha512-jhXqQAQVM+8Xj5EjJGVweuEzgtGWb3tmEEpl3CLP3cStInSbVHSg0QWOGQzNq8pSID4JkpeV2mPqlMDLrm0/Vw=="
},
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
},
"source-map-js": {
"version": "1.2.1",
"resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.2.1.tgz",
"integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="
},
"ts-custom-error": {
"version": "3.3.1",
"resolved": "https://registry.npmmirror.com/ts-custom-error/-/ts-custom-error-3.3.1.tgz",
"integrity": "sha512-5OX1tzOjxWEgsr/YEUWSuPrQ00deKLh6D7OTWcvNHm12/7QPyRh8SYpyWvA4IZv8H/+GQWQEh/kwo95Q9OVW1A=="
},
"vue": {
"version": "2.7.16",
"resolved": "https://registry.npmmirror.com/vue/-/vue-2.7.16.tgz",
"integrity": "sha512-4gCtFXaAA3zYZdTp5s4Hl2sozuySsgz4jy1EnpBHNfpMa9dK1ZCG7viqBPCwXtmgc8nHqUsAu3G4gtmXkkY3Sw==",
"requires": {
"@vue/compiler-sfc": "2.7.16",
"csstype": "^3.1.0"
}
},
"vue-qrcode-reader": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/vue-qrcode-reader/-/vue-qrcode-reader-3.0.0.tgz",
"integrity": "sha512-44TT0PQxMOBtSiJg+8/lM9jXGIBEtp2U3sy642uv13IfKquwEv1UtNyof2y8lILsRX7cn7xt0XkUahIHWyEXAQ==",
"requires": {
"barcode-detector": "^0.5.0",
"callforth": "^0.3.1",
"core-js": "^3.6.5",
"vue": "^2.6.11",
"webrtc-adapter": "7.7.0"
}
},
"webrtc-adapter": {
"version": "7.7.0",
"resolved": "https://registry.npmmirror.com/webrtc-adapter/-/webrtc-adapter-7.7.0.tgz",
"integrity": "sha512-7Bp9OBnx642oJRkom1tNAbeJjUadAq2rh5xLL9YXPw5hVyt2h4hHr5bcoPYDs1stp/mZHSPSQA34YISdnr0DBQ==",
"requires": {
"rtcpeerconnection-shim": "^1.2.15",
"sdp": "^2.12.0"
}
}
}
}

20
package.json

@ -0,0 +1,20 @@
{
"name": "tourGuide",
"version": "1.0.0",
"description": "",
"main": "main.js",
"dependencies": {
"vue-qrcode-reader": "^3.0.0"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "http://47.114.134.244:3000/chenkainan/tourGuide.git"
},
"keywords": [],
"author": "",
"license": "ISC"
}

10
pages.json

@ -54,9 +54,9 @@
}
},
{
"path": "user/register",
"path": "user/userInfo",
"style": {
"navigationBarTitleText": "注册信息"
"navigationBarTitleText": "请完善导游信息"
}
},
{
@ -65,6 +65,12 @@
"navigationBarTitleText": "账号密码"
}
},
{
"path": "video/index",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "order/orderList",
"style": {

64
pages/verification/index.vue

@ -128,67 +128,45 @@
</view>
</uni-popup>
<template v-if="showScan">
<scanCodeVue ref="scanCodeVueRef" @success="getCode" @fail="scanFail"></scanCodeVue>
</template>
</view>
</template>
<script>
// import wxsdk from 'weixin-js-sdk'
// todo H5
// https://ask.dcloud.net.cn/article/35380
import scanCodeVue from "../../components/scanCode.vue"
export default {
components:{scanCodeVue},
data() {
return {
type: 0,
HXCode: '', //
HXPhone:"",
orderList: [],
showScan: false,
};
},
onShow() {
},
async onLoad() {
await this.initWXSKD()
onLoad() {
},
methods: {
async initWXSKD () {
try {
if (window.navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == "micromessenger") {
let that = this
let res = await this.Post({
web_url: encodeURIComponent(window.location.href.split('#')[0]),
apis: 'scanQRCode'
}, '/api/wx/jsSdk')
if (res) {
let data = res.jssdk
//
wxsdk.config({
debug: false,
appId: data.appId,
timestamp: data.timestamp,
nonceStr: data.nonceStr,
signature: data.signature,// + "asdfasdf",//
jsApiList: ['scanQRCode']
});
}
}
} catch (e) {}
},
//
scanCode () {
let _this = this
uni.showLoading()
wxsdk.scanQRCode({
needResult: 1, // 01
scanType: ["qrCode", "barCode"], //
success: function (res) {
uni.hideLoading()
alert(res.resultStr.split('?')[1].split('=')[1])
// _this.getOrderByCode(res.resultStr.split('?')[1].split('=')[1])
this.showScan = true
},
fail: function (error) {
uni.hideLoading()
}
getCode (res) {
console.log(res)
this.showScan = false
},
scanFail(res) {
this.showScan = false
uni.showToast({
title: res,icon:"none"
})
},
@ -213,10 +191,10 @@
//
searchByPhone () {
if (this.HXPhone == '') {
this.$toast('请输入手机号')
uni.showToast({title:'请输入手机号',icon:"none"})
return
} else if (this.HXPhone.length < 4) {
this.$toast('查询手机号最低4位')
uni.showToast({title:'查询手机号最低4位',icon:"none"})
return
}
// this.Post({

2
static/js/CommonFunction.js

@ -66,7 +66,7 @@ Vue.prototype.showImg = img => {
if (img.indexOf('https://') != -1 || img.indexOf('http://') != -1) {
return img;
} else {
return 'https://tlgz.sz-trip.com' + img;
return 'http://47.103.142.123:1010' + img;
}
}

470
subPackages/user/infoFilling.vue

@ -10,33 +10,103 @@
<view v-else class="empty-value" >请选择</view>
</view>
</view>
<!-- 语言 -->
<view class="lingo-container" v-else-if="valueType=='lingo_ids'">
<view class="userinfo-item" @click="changeSelection({arr:lingoIds, })">
<span>语言能力</span>
<view v-if="inputValueStr" class="text-overflow" >{{inputValueStr}}</view>
<view class="userinfo-item" v-for="(item,i) in lingoIds" :key="i" @click="changeSelection(item)">
<span>{{item.name}}</span>
<view v-if="item.value.length>0" class="text-overflow" >{{item.valueStr}}</view>
<view v-else class="empty-value" >请选择</view>
</view>
<view class="language-doc-container">
<span>证明材料</span>
<view class="img-container">
<image :src="file.img" class="doc-image" v-for="(file,i) in fileList" :key="i"></image>
<view v-for="(file,i) in fileList" class="doc-image" :key="i">
<image :src="file" class="doc-image" ></image>
<view class="doc-del" @click.native="removeFile(i)">x</view>
</view>
<view class="doc-image" @click="uploadImg">
<!-- <image class="upload-image" src=""></image> -->
111
<view class="doc-image flex flex-center" @click="uploadImage()">
<image class="upload-image" :src="showImg('/uploads/20241202/33e04a3b13241a6705616f6d6db315ce.png')"></image>
</view>
</view>
</view>
</view>
<!-- 亮点 -->
<view class="scenic-container" v-else-if="valueType=='sparkle_text'">
<view class="userinfo-item" v-for="(item,i) in speakText" :key="i">
<span>{{i==0?'主亮点':`副亮点${i}`}}</span>
<view class="point">
<input v-model="item.text" type="text" placeholder="请输入内容" />
<uni-icons v-if="i!=0" class="del-icon" type="trash" size="20" @click.native="delText(i)"></uni-icons>
</view>
</view>
<view class="add-btn" @click="addText">+ 添加更多</view>
</view>
<!-- 视频 -->
<view class="video-container" v-else-if="valueType=='video_list'">
<view class="top-del" style="text-align: right;padding-bottom: 15rpx;position: relative;">
<uni-icons type="trash" size="19" @click.native="changeDeleteMode(true)"></uni-icons>
<view v-if="deleteIndex.length>0" class="del-num">{{deleteIndex.length}}</view>
</view>
<view class="video-upload-container">
<view v-show="!deleteMode" class="video-upload-image flex flex-column flex-center"
@click="uploadVideo()" style="border: 1px dashed #ADADAD;">
<image class="upload-image" style="margin-bottom: 12rpx;" :src="showImg('/uploads/20241202/33e04a3b13241a6705616f6d6db315ce.png')"></image>
上传视频
</view>
<view class="video-upload-image" v-for="(file,i) in fileList" :key="i">
<video :src="file" class="video-upload-image" preload="metadata"
:controls="false" :show-progress="false" :show-fullscreen-btn="false"
:show-play-btn="false" :show-center-play-btn="false" :show-loading="false"></video>
<view class="cover-div">
<view class="cover-play" @click="playVideo(file)">
<image style="width: 66rpx;height: 66rpx;" :src='showImg("/uploads/20241202/44b29b02b77b0a0342bb38c2d9282f49.png")'></image>
</view>
<view :class="['delete-container', deleteIndex.includes(i)?'selected':'']" v-if="deleteMode" @click.stop="changeDeleteIndex(i)">
<image v-if="!deleteIndex.includes(i)" :src="showImg('/uploads/20241202/b6e64e71e01a6cfd8ade6c639583357b.png')" title="未选中"></image>
<image v-else :src="showImg('/uploads/20241202/21f56765ccdc74a07fbd3b30a72a87a0.png')" title="选中"></image>
</view>
</view>
</view>
</view>
</view>
<view class="nickname-box" v-else>
<input v-model="inputValue" type="text" placeholder="请输入内容" />
</view>
<!-- 底部保存 -->
<view class="btn-tao" @click="submit" v-if="!['scenic_ids','sparkle_text','video_list'].includes(valueType)">保存</view>
<view class="bottom-btn" v-if="['scenic_ids','sparkle_text'].includes(valueType)">
<view class="btn" @click="goBack()" >取消</view>
<view class="btn" @click="submit()" >保存</view>
</view>
<view class="btn-tao" @click="submit">保存</view>
<view class="bottom-btn-fixed" v-if="['video_list'].includes(valueType)">
<template v-if="!deleteMode">
<view class="btn" @click="goBack()" >取消</view>
<view class="btn" @click="submit()" >保存</view>
</template>
<template v-else>
<view class="btn" @click="changeDeleteMode(false)" >取消删除</view>
<view class="btn" @click="confirmDelVideo()" >确认删除</view>
</template>
</view>
</view>
<!-- 弹框 -->
<uni-popup ref="popup" type="bottom">
@ -80,14 +150,20 @@
{key: 'bio',value: '个性签名'},
{key: 'scenic_ids',value: '擅长景区'},
{key: 'lingo_ids',value: '语言能力'},
{key: 'sparkle_text', value: '核心亮点'},
{key:'video_list', value: '讲解视频'}
],
lingoIds: [],
scenicIds: [],
speakText: [],
selectionItem: null, //
selection: {arr: [], value: [], valueStr: ''}, //
fileList: []
fileList: [],
deleteIndex: [],
deleteMode: false, //
}
},
onLoad(options) {
@ -101,6 +177,12 @@
this.valueType = ''
this.inputValue = ''
this.inputValueStr = ''
this.deleteMode = false
this.fileList = []
this.speakText = []
if (options.inputValue && options.inputValue!='null' && options.inputValue!='undefined') {
this.inputValue = options.inputValue
}
if (options.valueType) {
this.valueType = options.valueType
let titleData = this.keyNames.find(v=>v.key == this.valueType)
@ -113,31 +195,46 @@
if (this.valueType == 'scenic_ids') {
this.initScenicList()
}
if (this.valueType == 'sparkle_text') {
this.initSparkleText()
}
if (this.valueType == 'video_list') {
this.initVideo()
}
} else {
this.goBack()
return
}
if (options.inputValue && options.inputValue!='null' && options.inputValue!='undefined') {
this.inputValue = options.inputValue
}
},
},
//
async initLingoList() {
//
let res = await this.Post({},'/api/guide/getGuideLingoList').then(res =>{
this.lingoIds = res.data
})
this.lingoIds = (this.$store.state.user.lingoIds || []).map(v=>{
return {...v, value: [], valueStr: ""}
let res = await this.Post({},'/api/guide/getGuideLingoList')
let valueArr = []
try {
valueArr = (this.inputValue || '').split(',').map(v=>{return Number(v)})
} catch(e) {}
console.log(valueArr)
let param = [{arr: res.data||[],name:'语言能力'}]
this.lingoIds = param.map(v=>{
let valueHave = v.arr.filter(x=>valueArr.includes(x.id))
return {...v, value: valueHave.map(x=>x.id), valueStr: valueHave.map(x=>x.name).join(',')}
})
try {
let fileList = uni.getStorageSync('userfileList')
this.fileList = JSON.parse(fileList)
console.log(this.fileList)
} catch(e) {
this.fileList = []
}
},
//
async initScenicList() {
//
let res = await this.Post({},'/api/guide/getGuideScenicList')
let valueArr = []
try {
@ -149,6 +246,31 @@
return {...v, value: valueHave.map(x=>x.id), valueStr: valueHave.map(x=>x.name).join(',')}
})
},
//
initSparkleText () {
let arr = (this.inputValue||'').split(',').map(v=>{
return {text: v}
})
this.speakText = arr
},
//
initVideo () {
try {
let fileList = uni.getStorageSync('userVideofileList')
this.fileList = JSON.parse(fileList)
console.log(this.fileList)
} catch(e) {
this.fileList = []
}
},
addText () {
this.speakText.push({text:''})
},
delText (index) {
this.speakText.splice(index,1)
},
changeSelection (item) {
this.selectionItem = item
@ -167,24 +289,24 @@
selectAll() {
this.selection.value = this.selection.arr.map(x=>x.id)
},
//
popSubmit () {
let tempSelect = JSON.parse(JSON.stringify(this.selection))
if (['scenic_ids'].includes(this.valueType)) {
let valueHave = tempSelect.arr.filter(x=>tempSelect.value.includes(x.id))
if (['scenic_ids','lingo_ids'].includes(this.valueType)) {
this.selectionItem.value = tempSelect.value
this.selectionItem.valueStr = valueHave.map(x=>x.name).join(',')
} else if (['lingo_ids'].includes(this.valueType)) {
this.inputValue = tempSelect.value
this.inputValueStr = tempSelect.valueStr
}
this.$refs.popup.close()
},
uploadImg() {
let url = this.NEWAPIURL+'/api/api/Common/upload'
let merchants_token =''
if (uni.getStorageSync('userInfo') && JSON.parse(uni.getStorageSync('userInfo')).token) merchants_token = JSON.parse(uni.getStorageSync('userInfo')).token
uploadImage() {
let _this = this
let url = this.NEWAPIURL
// #ifdef H5
url = '/api'
// #endif
url+='/api/Common/upload'
uni.chooseImage({
count:1,
success: (res) => {
@ -198,13 +320,65 @@
url: url,
filePath: tempFilePaths[0],
name: 'file',
header: {
'merchants_token': merchants_token || ''
header: {"token": '7e4bd097-8298-4cbe-8c75-535874a5c0e0'},
success: (uploadFileRes) => {
try {
let res = JSON.parse(uploadFileRes.data)
if (res.code == 1) {
_this.fileList.push(res.data.fullurl)
}
} catch(e) {}
},
fail:()=> {
uni.showToast({
title:'上传失败',
icon:'none'
})
}
});
},
fail:()=> {
uni.showToast({
title:'上传失败',
icon:'none'
})
}
});
},
uploadVideo() {
let _this = this
let url = this.NEWAPIURL
// #ifdef H5
url = '/api'
// #endif
url+='/api/Common/upload'
uni.showLoading()
uni.chooseVideo({
count:1,
success: (res) => {
const tempFilePath = res.tempFilePath;
const uploadTask = uni.uploadFile({
url: url,
filePath: tempFilePath,
name: 'file',
header: {"token": '7e4bd097-8298-4cbe-8c75-535874a5c0e0'},
success: (uploadFileRes) => {
console.log(uploadFileRes.data);
uni.hideLoading()
try {
let res = JSON.parse(uploadFileRes.data)
if (res.code == 1) {
_this.fileList.push(res.data.fullurl)
}
} catch(e) {}
},
fail:()=> {
uni.hideLoading()
uni.showToast({
title:'上传失败',
icon:'none'
@ -214,6 +388,7 @@
},
fail:()=> {
uni.hideLoading()
uni.showToast({
title:'上传失败',
icon:'none'
@ -222,10 +397,40 @@
});
},
//
removeFile(index) {
this.fileList.splice(index,1)
},
playVideo (file) {
let url = encodeURIComponent(file)
uni.navigateTo({
url: `/subPackages/video/index?url=${url}`
})
},
changeDeleteMode (value) {
this.deleteIndex = []
this.deleteMode = value
},
changeDeleteIndex (index) {
let i = this.deleteIndex.findIndex(v=>v==index)
if (i>=0) {
this.deleteIndex.splice(i,1)
} else {
this.deleteIndex.push(index)
}
console.log(this.deleteIndex)
},
confirmDelVideo () {
this.fileList = this.fileList.filter((v,i)=>!this.deleteIndex.includes(i))
this.changeDeleteMode(false)
},
//
handleSubmitData() {
//
if (["scenic_ids"].includes(this.valueType)) {
if (["scenic_ids","lingo_ids"].includes(this.valueType)) {
let data = []
if (this.valueType == 'lingo_ids') {
data = this.lingoIds
@ -244,17 +449,36 @@
this.inputValueStr = value.map(v=>v.valueStr).join(',')
console.log(this.inputValue,this.inputValueStr)
}
if (this.valueType == 'sparkle_text') {
if (!this.speakText[0].text) {
uni.showToast({
title: '主亮点必填',
icon:'none'
})
return true
}
this.inputValue = this.speakText.filter(v=>v.text)
this.inputValueStr = this.inputValue.map(v=>v.text).join(',')
}
if (this.valueType == 'video_list') {
this.inputValue = JSON.parse(JSON.stringify(this.fileList))
this.inputValueStr = ''
}
},
submit() {
this.handleSubmitData()
let res = this.handleSubmitData()
if (res) return
uni.$emit("updateInfo", {
msgType: 'registerInfo',
data: {
valueType: this.valueType,
inputValue: this.inputValue,
inputValueStr: this.inputValueStr
inputValueStr: this.inputValueStr,
fileList: this.fileList
}
})
this.goBack()
@ -344,7 +568,7 @@
box-sizing: border-box;
}
.popup-content{
max-height: 900rpx;
max-height: 500rpx;
width: 100%;
overflow-x: hidden;
overflow-y: auto;
@ -396,6 +620,20 @@
}
}
.del-num{
position: absolute;
top: -5rpx;
right: -10rpx;
background: #E5131B;
color: white;
width: 24rpx;
height: 24rpx;
text-align: center;
line-height: 24rpx;
font-size: 20rpx;
border-radius: 50%;
}
.language-doc-container{
display: flex;
align-items: flex-start;
@ -415,8 +653,22 @@
width: 141rpx;
height: 151rpx;
border-radius: 13rpx;
margin: 0 20rpx 20rpx 0;
margin: 0 40rpx 20rpx 0;
background: #F1F1F1;
position: relative;
}
.doc-del{
width: 40rpx;
height: 40rpx;
display: flex;
align-items: center;
justify-content: center;
background: black;
color: white;
position: absolute;
top: -10rpx;
right: -10rpx;
border-radius: 50%;
}
.upload-image{
@ -425,4 +677,142 @@
}
}
}
.userinfo-item .point{
display: flex;
align-items: center;
justify-content: space-between;
input{
font-size: 28rpx;
}
.del-icon{
padding-left: 20rpx;
}
}
.add-btn{
width: 343rpx;
height: 72rpx;
background: #F1F1F1;
border-radius: 13rpx;
line-height: 72rpx;
text-align: center;
font-weight: 500;
font-size: 28rpx;
margin: 55rpx auto 0;
}
.video-upload-container{
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.upload-image{
width: 72rpx;
height: 68.67rpx;
}
.video-upload-image{
width: 330rpx;
height: 330rpx;
background: #F1F1F1;
border-radius: 10rpx;
margin-bottom:20rpx;
position: relative;
overflow: hidden;
.cover-div{
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
.cover-play{
width: 100%;
height: 100%;
top: 0;
left: 0;
display: flex;
align-items: center;
justify-content: center;
color: white;
position: absolute;
z-index: 5;
}
.delete-container{
width: 100%;
height: 100%;
top: 0;
left: 0;
position: absolute;
z-index: 10;
padding: 20rpx;
image{
width: 44rpx;
height: 44rpx;
}
}
.delete-container.selected{
background: rgba(0,0,0,0.8);
}
}
}
}
.bottom-btn{
padding: 66rpx 80rpx 0;
display: flex;
justify-content: space-between;
.btn{
width: 244rpx;
height: 81rpx;
border-radius: 40rpx;
border: 1px solid #000000;
line-height: 81rpx;
text-align: center;
font-weight: 500;
font-size: 36rpx;
color: #010101;
}
.btn:last-of-type{
background: #96684F;
border: none;
color: #FFFFFF;
}
}
.bottom-btn-fixed{
position: fixed;
bottom: 0;
left: 0;
right: 0;
width: 100%;
height: 133rpx;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 24rpx 0rpx rgba(102,102,102,0.24);
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 92rpx;
box-sizing: border-box;
.btn{
width: 244rpx;
height: 81rpx;
border-radius: 40rpx;
border: 1px solid #000000;
line-height: 81rpx;
text-align: center;
font-weight: 500;
font-size: 36rpx;
color: #010101;
}
.btn:last-of-type{
background: #96684F;
border: none;
color: #FFFFFF;
}
}
</style>

237
subPackages/user/register.vue

@ -1,7 +1,7 @@
<template>
<view class="bg">
<view class="header-tip">请填写您的信息稍后平台工作人员会电话联系您~</view>
<!-- <view class="header-tip">请填写您的信息稍后平台工作人员会电话联系您~</view> -->
<view style="height: 20rpx;"></view>
<view class="user-other-info">
<view class="info-title">·基础信息</view>
<div class="info-avatar-top">
@ -59,20 +59,20 @@
<view class="text-overflowRows" v-if="info.bio">{{info.bio}}</view>
<view v-else class="empty-value">请填写</view>
</view>
<view class="userinfo-item">
<view class="userinfo-item" @click="changeValue('sparkle_text')">
<span>核心亮点</span>
<view class="text-overflow" v-if="info.bio">{{info.bio}}</view>
<view class="text-overflow" v-if="info.sparkle_textStr">{{info.sparkle_textStr}}</view>
<view v-else class="empty-value">请填写</view>
</view>
<view class="info-title" style="margin-top: 46rpx;">·讲解视频</view>
<view class="userinfo-item" @click="selectRank">
<view class="userinfo-item" @click="changeValue('video_list')">
<span>讲解视频</span>
<view class="text-overflow" v-if="info.rankStr">{{info.rankStr}}</view>
<view class="text-overflow" v-if="info.video_list.length>0">{{info.video_list.length}}</view>
<view v-else class="empty-value">请选择</view>
</view>
<view class="btn-tao" @click="submit">我已填好</view>
<view class="btn-tao" @click="submit">保存修改</view>
</view>
</view>
@ -89,9 +89,11 @@
gender: null, genderStr: '',
group_id: null,group_idStr: '',
certificate_number: '',duration:'',
lingo_ids: null, lingo_idsStr:'',
lingo_ids: null, lingo_idsStr:'',lingo_idsFileList: [],
scenic_ids: null, scenic_idsStr:'',
bio:''
bio:'', video_list: [],
sparkle_text: [],
sparkle_textStr: '',
},
groupIds: [], //
@ -111,32 +113,94 @@
},
onLoad () {
this.Post({}, '/api/Merchants/get_graphic').then(res => {})
this.getUserInfo()
this.initSelect()
},
methods: {
//
getUserInfo () {
this.Post({}, '/api/Merchants/get_login_details').then(res => {
let resData = res.data
let lingo_idsFileList = []
let video_list = []
try {
lingo_idsFileList = (resData.lingo_image_list || '').split(',').filter(v=>v)
video_list = (resData.video_list || '').split(',').filter(v=>v)
} catch(e){}
this.info = {
id: resData.id,avatar: resData.avatar,
nickname: resData.nickname, mobile: resData.mobile,
certificate_number: resData.certificate_number,
duration:resData.duration,bio:resData.bio,
gender: resData.gender, genderStr: resData.gender == 1?'男':'女',
group_id: resData.group_id,group_idStr: resData.group_data.name,
lingo_ids: resData.lingo_data.lingo_id,
lingo_idsStr:resData.lingo_data.name,
lingo_idsFileList: lingo_idsFileList,
scenic_ids: resData.scenic_data.scenic_id,
scenic_idsStr:resData.scenic_data.name,
sparkle_text: (resData.sparkle_text || []),
sparkle_textStr:(resData.sparkle_text || []).map(v=>v.text).join(','),
video_list: video_list,
}
})
},
initSelect () {
//
this.Post({}, '/api/guide/getGuideGroupList').then(res => {
this.groupIds = res.data
})
},
//
uploadAvator () {
let _this = this
let url = this.NEWAPIURL
// #ifdef H5
url = '/api'
// #endif
url+='/api/Common/upload'
uni.chooseImage({
count: 1,
success: (chooseImageRes) => {
const tempFilePaths = chooseImageRes.tempFilePaths;
pathToBase64(tempFilePaths[0]).then(base64 => {
_this.info.avatar = base64
console.log(_this.info)
count:1,
success: (res) => {
const tempFilePaths = res.tempFilePaths;
const uploadTask = uni.uploadFile({
url: url,
filePath: tempFilePaths[0],
name: 'file',
header: {"token": '7e4bd097-8298-4cbe-8c75-535874a5c0e0'},
success: (uploadFileRes) => {
try {
let res = JSON.parse(uploadFileRes.data)
if (res.code == 1) {
_this.info.avatar = res.data.fullurl
}
} catch(e) {}
},
fail:()=> {
uni.showToast({
title:'上传失败',
icon:'none'
})
}
});
},
fail:()=> {
uni.showToast({
title:'上传失败',
icon:'none'
})
}
});
},
selectSex () {
let _this = this
@ -175,8 +239,19 @@
//
changeValue(valueType) {
let inputValue = this.info[valueType]
if (valueType == "lingo_ids") {
uni.setStorageSync("userfileList",JSON.stringify(this.info.lingo_idsFileList))
}
if (valueType == 'video_list') {
uni.setStorageSync("userVideofileList",JSON.stringify(this.info.video_list))
}
if (valueType == 'sparkle_text') {
inputValue = this.info.sparkle_textStr
}
uni.navigateTo({
url: `/subPackages/user/infoFilling?valueType=${valueType}&inputValue=${this.info[valueType]}`
url: `/subPackages/user/infoFilling?valueType=${valueType}&inputValue=${inputValue}`
})
},
@ -186,89 +261,85 @@
console.log(data.data)
let valueType = data.data.valueType
let valueTypeStr = valueType + 'Str'
let fileListStr = valueType+'FileList'
let inputValue = data.data.inputValue
let inputValueStr = data.data.inputValueStr
let fileList = data.data.fileList
this.info[valueType] = inputValue
if (this.info[valueTypeStr] !== undefined && inputValueStr) {
this.info[valueTypeStr] = inputValueStr
}
if (this.info[fileListStr] && fileList) {
this.info[fileListStr] = fileList
}
console.log(this.info)
}
},
uploadImg() {
uni.chooseImage({
success: (chooseImageRes) => {
const tempFilePaths = chooseImageRes.tempFilePaths;
// // #ifdef MP-WEIXIN
// uni.getFileSystemManager().readFile({
// filePath: tempFilePaths[0],
// encoding: 'base64',
// success: res => {
// this.Post({
// method: 'POST',
// base64: 'data:image/png;base64,' + res.data
// }, '/api/common/base64').then(res => {
// if (res.data) {
// this.Post({
// avatar: res.data
// }, '/api/user/profile').then(res => {
// uni.showModal({
// title: '',
// content: res.msg,
// showCancel: false,
// success: res => {
// if (res.confirm) {
// this.getList()
// }
// }
// })
// })
// }
// })
// }
// })
// // #endif
pathToBase64(tempFilePaths[0]).then(base64 => {
this.Post({
method: 'POST',
base64: base64
}, '/api/common/base64').then(res => {
if (res.data) {
this.Post({
avatar: res.data
}, '/api/user/profile').then(res => {
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false,
success: res => {
if (res.confirm) {
this.getList()
submit() {
//
if (!this.info.nickname) {
uni.showToast({title:"请输入姓名",icon:"none"})
return
}
if(!this.info.avatar) {
uni.showToast({title:"请上传头像",icon:"none"})
return
}
})
})
if (!this.info.gender) {
uni.showToast({title:"请选择性别",icon:"none"})
return
}
})
})
if (!this.info.mobile || !this.IsTel(this.info.mobile)) {
uni.showToast({title: "请输入正确的手机号码",icon: 'none'})
return;
}
});
},
if (!this.info.group_id) {
uni.showToast({title: "请选择导游等级",icon: 'none'})
return;
}
if (!this.info.certificate_number) {
uni.showToast({title: "请输入导游证号",icon: 'none'})
return;
}
if (!this.info.duration) {
uni.showToast({title: "请输入工作年限",icon: 'none'})
return;
}
if (!this.info.lingo_ids || this.info.lingo_idsFileList.length<=0) {
uni.showToast({title: "请选择语言能力并上传证明材料",icon: 'none'})
return;
}
if (!this.info.scenic_ids) {
uni.showToast({title: "请选择擅长景区",icon: 'none'})
return;
}
if (!this.info.bio) {
uni.showToast({title: "请输入个性签名",icon: 'none'})
return;
}
if (this.info.sparkle_text.length<=0) {
uni.showToast({title: "请输入核心亮点",icon: 'none'})
return;
}
console.log(this.info)
let param = {
...this.info,
lingo_image_list: this.info.lingo_idsFileList.join(','),
video_list: this.info.video_list.join(','),
}
submit() {
uni.showModal({
title: '提示',
content: '确认修改您的信息?',
success: res => {
if (res.confirm) {
this.Post({
nickname: this.nickname,
gender: this.gender,
birthday: this.birthday
}, '/api/user/profile').then(res => {
this.Post(param, '/api/Merchants/update_guide_details').then(res => {
console.log(res)
if (res.code == 1) {
uni.showModal({
@ -277,7 +348,7 @@
showCancel: false,
success: res => {
if (res.confirm) {
this.getList()
this.getUserInfo()
}
}
})

569
subPackages/user/userInfo.vue

@ -0,0 +1,569 @@
<template>
<view class="bg">
<!-- <view class="header-tip">请填写您的信息稍后平台工作人员会电话联系您~</view> -->
<view style="height: 20rpx;"></view>
<view class="user-other-info">
<view class="info-title">·基础信息</view>
<div class="info-avatar-top">
<span>头像</span>
<view @click="uploadAvator()">
<image v-if="info.avatar" :src="info.avatar" mode="aspectFill"
style="width: 80rpx;height: 80rpx;border-radius: 50%;"></image>
<div v-else style="width: 80rpx;height: 80rpx;border-radius: 50%;background: #0B898E;"></div>
</view>
</div>
<view class="userinfo-item" >
<span>姓名</span>
<view class="text-overflow" v-if="info.nickname">{{info.nickname}}</view>
<view v-else class="empty-value" >请填写</view>
</view>
<view class="userinfo-item" >
<span>性别</span>
<view class="text-overflow" v-if="info.genderStr">{{info.genderStr}}</view>
<view v-else class="empty-value" >请选择</view>
</view>
<view class="userinfo-item" >
<span>手机号</span>
<view v-if="info.mobile">{{info.mobile}}</view>
<view v-else class="empty-value" >请填写</view>
</view>
<view class="info-title" style="margin-top: 46rpx;">·工作相关</view>
<view class="userinfo-item" @click="selectRank">
<span>导游等级</span>
<view v-if="info.group_idStr">{{info.group_idStr}}</view>
<view v-else class="empty-value">请选择</view>
</view>
<view class="userinfo-item" >
<span>导游证号</span>
<view class="text-overflow" v-if="info.certificate_number">{{info.certificate_number}}</view>
<view v-else class="empty-value">请填写</view>
</view>
<view class="userinfo-item" @click="changeValue('duration')">
<span>工作年限</span>
<view class="text-overflow" v-if="info.duration">{{info.duration}}</view>
<view v-else class="empty-value">请填写</view>
</view>
<view class="userinfo-item" @click="changeValue('lingo_ids')">
<span>语言能力</span>
<view class="text-overflow" v-if="info.lingo_idsStr">{{info.lingo_idsStr}}</view>
<view v-else class="empty-value">请选择</view>
</view>
<view class="userinfo-item" @click="changeValue('scenic_ids')">
<span>擅长景区</span>
<view class="text-overflow" v-if="info.scenic_idsStr">{{info.scenic_idsStr}}</view>
<view v-else class="empty-value">请选择</view>
</view>
<view class="userinfo-item" @click="changeValue('bio')">
<span>个性签名</span>
<view class="text-overflowRows" v-if="info.bio">{{info.bio}}</view>
<view v-else class="empty-value">请填写</view>
</view>
<view class="userinfo-item" @click="changeValue('sparkle_text')">
<span>核心亮点</span>
<view class="text-overflow" v-if="info.sparkle_textStr">{{info.sparkle_textStr}}</view>
<view v-else class="empty-value">请填写</view>
</view>
<view class="info-title" style="margin-top: 46rpx;">·讲解视频</view>
<view class="userinfo-item" @click="changeValue('video_list')">
<span>讲解视频</span>
<view class="text-overflow" v-if="info.video_list.length>0">{{info.video_list.length}}</view>
<view v-else class="empty-value">请选择</view>
</view>
<view class="btn-tao" @click="submit">保存修改</view>
</view>
</view>
</template>
<script>
import {pathToBase64} from "@/static/js/mmmm-image-tools/index.js"
export default {
data() {
return {
info: {
nickname: '',mobile:'',avatar: '',
gender: null, genderStr: '',
group_id: null,group_idStr: '',
certificate_number: '',duration:'',
lingo_ids: null, lingo_idsStr:'',lingo_idsFileList: [],
scenic_ids: null, scenic_idsStr:'',
bio:'', video_list: [],
sparkle_text: [],
sparkle_textStr: '',
},
groupIds: [], //
}
},
mounted() {
uni.$on("updateInfo",this.updateInfo)
},
beforeUnmount () {
console.log('触发off')
uni.$off("updateInfo",this.updateInfo)
},
beforeDestroy () {
console.log('触发off')
uni.$off("updateInfo",this.updateInfo)
},
onLoad () {
this.getUserInfo()
this.initSelect()
},
methods: {
//
getUserInfo () {
this.Post({}, '/api/Merchants/get_login_details').then(res => {
let resData = res.data
let lingo_idsFileList = []
let video_list = []
try {
lingo_idsFileList = (resData.lingo_image_list || '').split(',').filter(v=>v)
video_list = (resData.video_list || '').split(',').filter(v=>v)
} catch(e){}
this.info = {
id: resData.id,avatar: resData.avatar,
nickname: resData.nickname, mobile: resData.mobile,
certificate_number: resData.certificate_number,
duration:resData.duration,bio:resData.bio,
gender: resData.gender, genderStr: resData.gender == 1?'男':'女',
group_id: resData.group_id,group_idStr: resData.group_data.name,
lingo_ids: resData.lingo_data.lingo_id,
lingo_idsStr:resData.lingo_data.name,
lingo_idsFileList: lingo_idsFileList,
scenic_ids: resData.scenic_data.scenic_id,
scenic_idsStr:resData.scenic_data.name,
sparkle_text: (resData.sparkle_text || []),
sparkle_textStr:(resData.sparkle_text || []).map(v=>v.text).join(','),
video_list: video_list,
}
})
},
initSelect () {
//
this.Post({}, '/api/guide/getGuideGroupList').then(res => {
this.groupIds = res.data
})
},
//
uploadAvator () {
let _this = this
let url = this.NEWAPIURL
// #ifdef H5
url = '/api'
// #endif
url+='/api/Common/upload'
uni.chooseImage({
count:1,
success: (res) => {
const tempFilePaths = res.tempFilePaths;
const uploadTask = uni.uploadFile({
url: url,
filePath: tempFilePaths[0],
name: 'file',
header: {"token": '7e4bd097-8298-4cbe-8c75-535874a5c0e0'},
success: (uploadFileRes) => {
try {
let res = JSON.parse(uploadFileRes.data)
if (res.code == 1) {
_this.info.avatar = res.data.fullurl
}
} catch(e) {}
},
fail:()=> {
uni.showToast({
title:'上传失败',
icon:'none'
})
}
});
},
fail:()=> {
uni.showToast({
title:'上传失败',
icon:'none'
})
}
});
},
selectSex () {
let _this = this
let itemList = ['男','女']
let valueList = ['1','2']
uni.showActionSheet({
itemList: itemList,
success: function (res) {
let index = res.tapIndex;
_this.info.genderStr = itemList[index]
_this.info.gender = valueList[index]
},
fail: function (res) {
console.log(res.errMsg);
}
});
},
selectRank () {
let _this = this
let itemList = this.groupIds.map(v=>v.name)
let valueList = this.groupIds.map(v=>v.id)
uni.showActionSheet({
itemList: itemList,
success: function (res) {
let index = res.tapIndex;
_this.info.group_idStr = itemList[index]
_this.info.group_id = valueList[index]
},
fail: function (res) {
console.log(res.errMsg);
}
});
},
//
changeValue(valueType) {
let inputValue = this.info[valueType]
if (valueType == "lingo_ids") {
uni.setStorageSync("userfileList",JSON.stringify(this.info.lingo_idsFileList))
}
if (valueType == 'video_list') {
uni.setStorageSync("userVideofileList",JSON.stringify(this.info.video_list))
}
if (valueType == 'sparkle_text') {
inputValue = this.info.sparkle_textStr
}
uni.navigateTo({
url: `/subPackages/user/infoFilling?valueType=${valueType}&inputValue=${inputValue}`
})
},
//
updateInfo(data) {
if (data.msgType == 'registerInfo') {
console.log(data.data)
let valueType = data.data.valueType
let valueTypeStr = valueType + 'Str'
let fileListStr = valueType+'FileList'
let inputValue = data.data.inputValue
let inputValueStr = data.data.inputValueStr
let fileList = data.data.fileList
this.info[valueType] = inputValue
if (this.info[valueTypeStr] !== undefined && inputValueStr) {
this.info[valueTypeStr] = inputValueStr
}
if (this.info[fileListStr] && fileList) {
this.info[fileListStr] = fileList
}
console.log(this.info)
}
},
submit() {
//
// if (!this.info.nickname) {
// uni.showToast({title:"",icon:"none"})
// return
// }
if(!this.info.avatar) {
uni.showToast({title:"请上传头像",icon:"none"})
return
}
// if (!this.info.gender) {
// uni.showToast({title:"",icon:"none"})
// return
// }
// if (!this.info.mobile || !this.IsTel(this.info.mobile)) {
// uni.showToast({title: "",icon: 'none'})
// return;
// }
if (!this.info.group_id) {
uni.showToast({title: "请选择导游等级",icon: 'none'})
return;
}
// if (!this.info.certificate_number) {
// uni.showToast({title: "",icon: 'none'})
// return;
// }
if (!this.info.duration) {
uni.showToast({title: "请输入工作年限",icon: 'none'})
return;
}
if (!this.info.lingo_ids || this.info.lingo_idsFileList.length<=0) {
uni.showToast({title: "请选择语言能力并上传证明材料",icon: 'none'})
return;
}
if (!this.info.scenic_ids) {
uni.showToast({title: "请选择擅长景区",icon: 'none'})
return;
}
if (!this.info.bio) {
uni.showToast({title: "请输入个性签名",icon: 'none'})
return;
}
if (this.info.sparkle_text.length<=0) {
uni.showToast({title: "请输入核心亮点",icon: 'none'})
return;
}
console.log(this.info)
let param = {
method: "POST",
...this.info,
lingo_image_list: this.info.lingo_idsFileList.join(','),
video_list: this.info.video_list.join(','),
sparkle_text: JSON.stringify(this.info.sparkle_text)
}
delete param.nickname
delete param.gender
delete param.mobile
delete param.certificate_number
uni.showModal({
title: '提示',
content: '确认修改您的信息?',
success: res => {
if (res.confirm) {
this.Post(param, '/api/Merchants/update_guide_details').then(res => {
console.log(res)
if (res.code == 1) {
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false,
success: res => {
if (res.confirm) {
this.getUserInfo()
}
}
})
}
})
}
}
})
},
}
}
</script>
<style scoped lang="scss">
view {
box-sizing: content-box;
}
.bg{
min-height: 100vh;
overflow-x: hidden;
background: white;
padding-bottom: 50rpx;
}
.header-tip{
font-weight: 400;
font-size: 27rpx;
color: #585858;
padding: 33rpx 0;
text-align: center;
}
.empty-value{
font-weight: 500;
font-size: 28rpx;
color: #999999;
}
.info-avatar-top {
display: flex;
justify-content: space-between;
font-size: 28rpx;
border-bottom: 1rpx solid #D8D8D8;
padding: 40rpx 0;
height: 48rpx;
color: #333;
align-items: center;
}
.info-avatar-top view{
display: flex;
align-items: center;
}
.info-avatar-top view:after{
content: "";
width: 20rpx;
height: 20rpx;
margin-left: 6rpx;
background-image: url('https://static.ticket.sz-trip.com/tongli/images/user/rightIcon-gray.png');
background-size: 100% 100%;
}
.info-avatar-top img {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
margin-right: 10rpx;
}
.change-avatar-btn {
color: #FFF;
width: 220rpx;
margin: 0 auto;
line-height: 70rpx;
border-radius: 20rpx;
background: #4C93FF;
position: relative;
font-size: 34rpx;
}
.change-avatar-btn input {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
opacity: 0;
}
.user-other-info {
margin:0 30rpx;
.info-title{
font-weight: bold;
font-size: 32rpx;
color: #000000;
}
}
.userinfo-item {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 28rpx;
border-bottom: 1rpx solid #D8D8D8;
padding: 40rpx 30rpx 40rpx 0;
height: 48rpx;
color: #333;
position: relative;
}
.info-avatar-top span {
font-weight: 500;
font-size: 31rpx;
flex-shrink: 0;
}
.userinfo-item span {
font-weight: 500;
font-size: 31rpx;
flex-shrink: 0;
color: #000;
width: 200rpx;
}
.userinfo-item i {
font-weight: 500;
font-size: 24rpx;
color: #999999;
}
.userinfo-item {
& view::after {
content: "";
width: 20rpx;
height: 20rpx;
margin-left: 6rpx;
background-image: url('https://static.ticket.sz-trip.com/tongli/images/user/rightIcon-gray.png');
background-size: 100% 100%;
position: absolute;
right: 0;
margin: auto;
top: 0;
bottom: 0;
}
}
.birthday-box {
text-align: right;
}
.cropper {
width: auto;
height: 100%;
}
.cropper-content {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 1000;
}
.dialog-footer .change-avatar-btn {
position: fixed;
text-align: center;
bottom: 80rpx;
left: 50%;
margin-left: -110rpx;
}
.btn-tao {
text-align: center;
font-size: 30rpx;
width: 697rpx;
height: 80rpx;
background: #96684F;
border-radius: 40rpx;
line-height: 80rpx;
color: #FFFFFF;
margin-top: 55rpx;
}
.popup-box {
border-radius: 20rpx 20rpx 0rpx 0rpx;
background: #fff;
overflow: hidden;
.popup-item {
width: 697rpx;
height: 99rpx;
font-weight: 500;
font-size: 31rpx;
color: #12293C;
margin: auto;
}
.popup-item:nth-child(2) {
border: none;
border-bottom: 1rpx solid #D8D8D8;
border-top: 1rpx solid #D8D8D8;
}
.popup-items {
width: 100%;
height: 99rpx;
font-weight: 500;
font-size: 31rpx;
color: #12293C;
border-top: 13rpx solid #F2F2F2;
}
}
</style>

41
subPackages/video/index.vue

@ -0,0 +1,41 @@
<template>
<view class="bg">
<video class="video" v-if="url" :src="url" preload="metadata" ></video>
</view>
</template>
<script>
export default {
data() {
return {
url: ''
}
},
onLoad(option) {
console.log(option);
if (option.url) {
this.url = decodeURIComponent(option.url)
}else{
this.goBack()
}
console.log(this.url)
// 使web-view
}
}
</script>
<style lang="scss" scoped>
.bg{
width: 100%;
height: calc(100vh - 44px);
background: black;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
.video{
width: 100%;
}
}
</style>
Loading…
Cancel
Save