This commit is contained in:
lnn19986213 2024-03-01 13:31:29 +08:00
parent adb80b05c2
commit 99062299fa
7 changed files with 305 additions and 192 deletions

View File

@ -13,15 +13,15 @@
<view class="user_name"> <view class="user_name">
<view class="user_name_de"> <view class="user_name_de">
<view style="display: flex; "> <view style="display: flex; ">
<view style="width: 50%;"> <view style="margin-right: 10px;">
{{ userName }} {{ userName }}
</view> </view>
<view class="sf_textA" v-if="yhsf == '文艺工作者'"> <view class="sf_textA" v-if="yhsf == '文艺工作者'">
<image src="../../static/sfFws.png"></image> <image src="../../static/sfFws.png" mode="heightFix"></image>
</view> </view>
<view class="sf_textB" v-if="yhsf == '文艺爱好者'"> <view class="sf_textB" v-if="yhsf == '文艺爱好者'">
<image src="../../static/sfRc.png"></image> <image src="../../static/sfRc.png" mode="heightFix"></image>
</view> </view>
</view> </view>
@ -430,15 +430,11 @@
.sf_textA { .sf_textA {
width: 146rpx; height: 50rpx;
height: 48rpx;
margin-top: 12rpx;
} }
.sf_textB { .sf_textB {
width: 166rpx; height: 50rpx;
height: 48rpx;
margin-top: 12rpx;
} }
.sf_textC { .sf_textC {

View File

@ -179,6 +179,11 @@
// res // res
console.log("res", res.data); console.log("res", res.data);
this.userInfoObj = res.data; this.userInfoObj = res.data;
if(!res.data.association){
this.userInfoObj.association = {
name: ''
}
}
if(res.data.artAtt==""){ if(res.data.artAtt==""){
this.userInfoObj.artAtt= JSON.stringify([""]) this.userInfoObj.artAtt= JSON.stringify([""])
} }

View File

@ -136,6 +136,7 @@
appId: 'wx55b187e6ed92e2ac', appId: 'wx55b187e6ed92e2ac',
phone: '', phone: '',
jscode: '', jscode: '',
phone_code: ''
}, },
isWx: false, isWx: false,
imgFile: '', imgFile: '',
@ -147,7 +148,6 @@
}, },
methods: { methods: {
getImgFile() { getImgFile() {
//
this.http.request('/auth/getCodes', {}, "GET").then(res => { this.http.request('/auth/getCodes', {}, "GET").then(res => {
if (res.code == 200) { if (res.code == 200) {
this.imgFile = res.data.captchaImg this.imgFile = res.data.captchaImg
@ -179,18 +179,88 @@
url: '/pagesC/Login/RemeberPW' url: '/pagesC/Login/RemeberPW'
}) })
}, },
// close() {
// this.show = false
//
// getPhoneNumber(e) {
// if (e.detail.errMsg == "getPhoneNumber:ok") {
// this.wxDate.phone_encryptedData = e.detail.encryptedData
// this.wxDate.phone_iv = e.detail.iv
// this.getNumber(e.detail.code)
// } else if (e.detail.errMsg == "getPhoneNumber:fail user deny") {
// uni.showToast({ // uni.showToast({
// title: '', // title: '',
// icon: "error", // icon: "error",
// }); // });
// }
// }, // },
// getNumber(code) {
// this.load = true
// //
// this.http.request('/auth/wx/getPhone?code=' + code, {}, "POST").then(res => {
// if (res.code == 200) {
// this.wxDate.phone = res.data.phone_info.phoneNumber
// this.wechatLogin()
// }
// }).catch(e => {
// this.load = false
// uni.showToast({
// title: e.data.message,
// icon: "none",
// });
// })
// },
// wechatLogin() {
// let _this = this
// //
// uni.checkSession({
// provider: 'weixin',
// success: function(loginRes) {
// console.log('checkSession', loginRes);
// },
// fail: function(loginRes) {
// console.log('checkSession', loginRes);
// },
// });
// //
// let jsCode = ''
// uni.login({
// provider: 'weixin',
// success: function(loginRes) {
// jsCode = loginRes.code;
// console.log('login', {
// loginRes
// });
// _this.http.request('/auth/xcx_login', {
// code: jsCode,
// phone: _this.wxDate.phone
// }, "POST").then(res => {
// if (res.code == 200) {
// uni.setStorageSync('token', res.data.tokenValue)
// uni.redirectTo({
// url: '/pages/pageHome/pageHome'
// })
// }
// }).catch(e => {
// uni.showToast({
// title: e.data.message,
// icon: "none",
// });
// })
// },
// fail: function(loginRes) {
// console.log(loginRes)
// _this.load = false
// }
// });
// },
//
getPhoneNumber(e) { getPhoneNumber(e) {
if (e.detail.errMsg == "getPhoneNumber:ok") { if (e.detail.errMsg == "getPhoneNumber:ok") {
this.wxDate.phone_encryptedData = e.detail.encryptedData this.wxDate.phone_code = e.detail.code
this.wxDate.phone_iv = e.detail.iv this.getOpenId()
this.getNumber(e.detail.code)
} else if (e.detail.errMsg == "getPhoneNumber:fail user deny") { } else if (e.detail.errMsg == "getPhoneNumber:fail user deny") {
uni.showToast({ uni.showToast({
title: '您拒绝了请求', title: '您拒绝了请求',
@ -198,53 +268,16 @@
}); });
} }
}, },
getNumber(code) { getOpenId() {
this.load = true
//
this.http.request('/auth/wx/getPhone?code=' + code, {}, "POST").then(res => {
if (res.code == 200) {
this.wxDate.phone = res.data.phone_info.phoneNumber
this.wechatLogin()
}
}).catch(e => {
this.load = false
uni.showToast({
title: e.data.message,
icon: "none",
});
})
},
wechatLogin() {
let _this = this let _this = this
//
uni.checkSession({
provider: 'weixin',
success: function(loginRes) {
console.log('checkSession成功', loginRes);
},
fail: function(loginRes) {
console.log('checkSession失败', loginRes);
},
});
//
let jsCode = '' let jsCode = ''
uni.login({ uni.login({
provider: 'weixin', provider: 'weixin',
success: function(loginRes) { success: function(loginRes) {
jsCode = loginRes.code; jsCode = loginRes.code;
console.log('login重新登录', { _this.http.request('/auth/wx/getOpenId?code=' + jsCode, {}, "POST").then(res => {
loginRes
});
_this.http.request('/auth/xcx_login', {
code: jsCode,
phone: _this.wxDate.phone
}, "POST").then(res => {
if (res.code == 200) { if (res.code == 200) {
uni.setStorageSync('token', res.data.tokenValue) _this.wechatLogin(res.data)
uni.redirectTo({
url: '/pages/pageHome/pageHome'
})
} }
}).catch(e => { }).catch(e => {
uni.showToast({ uni.showToast({
@ -259,6 +292,27 @@
} }
}); });
}, },
wechatLogin(val) {
this.http.request('/auth/wx/getPhoneByOpenId', {
code: this.wxDate.phone_code,
openId: val
}, "POST").then(res => {
if (res.code == 200) {
uni.setStorageSync('token', res.data.tokenValue)
uni.redirectTo({
url: '/pages/pageHome/pageHome'
})
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
},
login() { login() {
if (this.tab == 0) { if (this.tab == 0) {
this.load = true this.load = true

View File

@ -25,11 +25,8 @@
<u-parse :content="detailData.text"></u-parse> <u-parse :content="detailData.text"></u-parse>
</view> </view>
<!-- 附带文件 --> <!-- 附带文件 -->
<view class="file_box" v-for="(item,index) in list2" :key="index" @click="downLoad(item.url)"> <view class="file_box" v-if="list2.length > 0">
<view class="file_box_left"> <view class="file_box_right" v-for="(item,index) in list2" :key="index" @click="downLoad(item.url)">
<image :src="item.img" class="file_box_left_img"></image>
</view>
<view class="file_box_right">
<view class="file_box_name"> <view class="file_box_name">
{{item.name}} {{item.name}}
</view> </view>
@ -43,9 +40,9 @@
export default { export default {
data() { data() {
return { return {
list:[], list: [],
list2:[], list2: [],
id:'', id: '',
iswx: 0, iswx: 0,
detailData: {}, detailData: {},
} }
@ -65,28 +62,27 @@
this.iswx = 1 this.iswx = 1
// #endif // #endif
}, },
methods:{ methods: {
getData(){ getData() {
let _this = this let _this = this
this.http.request('/policy/details/' + this.id, {}, "GET").then(res => { this.http.request('/policy/details/' + this.id, {}, "GET").then(res => {
if (res.code == 200) { if (res.code == 200) {
if (res.data.files) { if (res.data.files) {
let fileArr = res.data.files.split(',') let fileArr = res.data.files.split(',')
fileArr.forEach(function(item) { fileArr.forEach(function(item,index) {
let gs = item.substr(item.lastIndexOf(".") + 1) let gs = item.substr(item.lastIndexOf(".") + 1)
console.log(item,gs) if (gs == 'jpg' || gs == 'jpeg' || gs == 'png' || gs == 'bmp' || gs ==
if (gs == 'jpg' || gs == 'jpeg' || gs == 'png' || gs == 'bmp' || gs == 'gif' || gs == 'tif' || gs == 'tiff') { 'gif' || gs == 'tif' || gs == 'tiff') {
_this.list.push(item) _this.list.push(item)
} else if (gs == 'pdf') { } else {
_this.list2.push({ _this.list2.push({
name: res.data.title + '.' + gs, name: res.data.title + index + '.' + gs,
img: '../../static/fileImg/pdfS.png', img: '../../static/fileImg/pdfS.png',
url: item, url: item,
}) })
} }
}) })
} }
console.log(this.list2)
this.detailData = res.data this.detailData = res.data
} }
}).catch(e => { }).catch(e => {
@ -98,24 +94,44 @@
}, },
// //
downLoad(val) { downLoad(val) {
this.contractUrl = val let urlPath = val
if(this.iswx == 0){ const token = uni.getStorageSync('token')
this.openPDF() if (this.iswx == 0) {
}else if(this.iswx == 1){ wx.downloadFile({
uni.navigateTo({ url: urlPath, //
url: "../ArtWorks/webView?url=" + this.contractUrl header: {
}) 'Authorization': "Bearer " + token,
'x-token': token
},
success(res) {
// success
if (res.statusCode === 200) {
const filePath = res.tempFilePath;
wx.openDocument({
filePath: filePath,
showMenu: true,
success: function(res) {
console.log(res, '打开文档成功');
} }
});
}
}
})
} else {
window.location.href = urlPath
}
}, },
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.workDetail{ .workDetail {
position: relative; position: relative;
width: 100%; width: 100%;
height: 100%; height: 100%;
.work_name { .work_name {
width: 92%; width: 92%;
margin: 10px 4%; margin: 10px 4%;
@ -128,15 +144,17 @@
.work_desc { .work_desc {
width: 92%; width: 92%;
margin: 10px 4%; margin: 10px 4%;
padding-bottom: 40rpx;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: #251B1D; color: #251B1D;
.work_desc_img{
.work_desc_img {
width: 100%; width: 100%;
} }
} }
.work_det{ .work_det {
width: 92%; width: 92%;
margin: 10px 4%; margin: 10px 4%;
height: 17px; height: 17px;
@ -145,20 +163,24 @@
color: #AFADB0; color: #AFADB0;
line-height: 17px; line-height: 17px;
overflow: hidden; overflow: hidden;
.det_box{
.det_box {
float: left; float: left;
margin-right: 20px; margin-right: 20px;
overflow: hidden; overflow: hidden;
.box_left{
.box_left {
width: 16px; width: 16px;
height: 16px; height: 16px;
float: left; float: left;
.img{
.img {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
} }
.box_right{
.box_right {
margin-left: 2px; margin-left: 2px;
float: left; float: left;
} }
@ -167,43 +189,29 @@
.file_box { .file_box {
width: 92%; width: 92%;
height: 64px;
margin: 10px 4%; margin: 10px 4%;
padding-bottom: 40rpx;
font-family: PingFangSC-Semibold, PingFang SC; font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600; font-weight: 600;
color: #251B1D; color: #251B1D;
background: #F4F5F7;
border-radius: 6px; border-radius: 6px;
overflow: hidden; overflow: hidden;
.file_box_left {
width: 40px;
height: 40px;
margin-top: 12px;
margin-left: 12px;
float: left;
.file_box_left_img {
width: 40px;
height: 40px;
}
}
.file_box_right { .file_box_right {
margin-left: 20px; background: #F4F5F7;
padding-left: 20px;
float: left; float: left;
width: calc(100% - 30rpx);
.file_box_name { .file_box_name {
height: 64px; line-height: 48rpx;
line-height: 64px; font-size: 28rpx;
font-size: 16px;
font-weight: 600; font-weight: 600;
color: #251B1D; color: #251B1D;
padding: 20rpx 0;
} }
} }
} }
} }
</style> </style>

View File

@ -25,8 +25,15 @@
<u-parse :content="serveList.context"></u-parse> <u-parse :content="serveList.context"></u-parse>
</view> </view>
<view class="work_desc" style="margin-top: 20px;" v-for="(v,i) in img" :key="i"> <view class="work_desc" style="margin-top: 20px;" v-for="(v,i) in img" :key="i">
<image :src="v" mode="widthFix" <image :src="v" mode="widthFix" class="work_desc_img"></image>
class="work_desc_img"></image> </view>
<!-- 附带文件 -->
<view class="file_box" v-if="list2.length > 0">
<view class="file_box_right" v-for="(item,index) in list2" :key="index" @click="downLoad(item.url)">
<view class="file_box_name">
{{item.name}}
</view>
</view>
</view> </view>
</view> </view>
@ -39,22 +46,49 @@
id: '', id: '',
serveList: {}, serveList: {},
img: [], img: [],
list2: [],
iswx: 0,
} }
}, },
onLoad(options) { onLoad(options) {
this.id = options.id this.id = options.id
}, },
onReady() {
// this.load = false
// #ifdef MP-WEIXIN
this.iswx = 0
// #endif
// #ifndef MP-WEIXIN
//
this.iswx = 1
// #endif
},
onShow() { onShow() {
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
})
this.getList() this.getList()
}, },
methods:{ methods: {
getList() { getList() {
let _this = this
this.http.request('/dynamic/details/' + this.id, {}, "GET").then(res => { this.http.request('/dynamic/details/' + this.id, {}, "GET").then(res => {
this.serveList = res.data this.serveList = res.data
if(res.data.imagePath){ if (res.data.imagePath) {
this.img = res.data.imagePath.split(',') this.img = res.data.imagePath.split(',')
} }
if (res.data.files) {
let fileArr = res.data.files.split(',')
fileArr.forEach(function(item,index) {
let gs = item.substr(item.lastIndexOf(".") + 1)
_this.list2.push({
name: res.data.title + index + '.' + gs,
url: item,
})
})
}
}).catch(e => { }).catch(e => {
uni.showToast({ uni.showToast({
title: e.data.message, title: e.data.message,
@ -62,15 +96,46 @@
}); });
}) })
}, },
//
downLoad(val) {
let urlPath = val
const token = uni.getStorageSync('token')
if (this.iswx == 0) {
wx.downloadFile({
url: urlPath, //
header: {
'Authorization': "Bearer " + token,
'x-token': token
},
success(res) {
// success
if (res.statusCode === 200) {
const filePath = res.tempFilePath;
wx.openDocument({
filePath: filePath,
showMenu: true,
success: function(res) {
console.log(res, '打开文档成功');
}
});
}
}
})
} else {
window.location.href = urlPath
}
},
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.workDetail{ .workDetail {
position: relative; position: relative;
width: 100%; width: 100%;
height: 100%; height: 100%;
.work_name { .work_name {
width: 92%; width: 92%;
margin: 10px 4%; margin: 10px 4%;
@ -83,16 +148,18 @@
.work_desc { .work_desc {
width: 92%; width: 92%;
margin: 10px 4%; margin: 10px 4%;
padding-bottom: 40rpx;
font-size: 14px; font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: #251B1D; color: #251B1D;
.work_desc_img{
.work_desc_img {
width: 100%; width: 100%;
} }
} }
.work_det{ .work_det {
width: 92%; width: 92%;
margin: 10px 4%; margin: 10px 4%;
height: 17px; height: 17px;
@ -102,63 +169,54 @@
color: #AFADB0; color: #AFADB0;
line-height: 17px; line-height: 17px;
overflow: hidden; overflow: hidden;
.det_box{
.det_box {
float: left; float: left;
margin-right: 20px; margin-right: 20px;
overflow: hidden; overflow: hidden;
.box_left{
.box_left {
width: 16px; width: 16px;
height: 16px; height: 16px;
float: left; float: left;
.img{
.img {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
} }
.box_right{
.box_right {
margin-left: 2px; margin-left: 2px;
float: left; float: left;
} }
} }
} }
.file_box{ .file_box {
width: 92%; width: 92%;
height: 64px;
margin: 10px 4%; margin: 10px 4%;
padding-bottom: 40rpx;
font-family: PingFangSC-Semibold, PingFang SC; font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600; font-weight: 600;
color: #251B1D; color: #251B1D;
background: #F4F5F7;
border-radius: 6px; border-radius: 6px;
overflow: hidden; overflow: hidden;
.file_box_left{
width: 40px; .file_box_right {
height: 40px; background: #F4F5F7;
margin-top: 12px; padding-left: 20px;
margin-left: 12px;
float: left; float: left;
.file_box_left_img{ width: calc(100% - 30rpx);
width: 40px;
height: 40px; .file_box_name {
} line-height: 48rpx;
} font-size: 28rpx;
.file_box_right{
margin-left: 20px;
float: left;
.file_box_name{
font-size: 16px;
font-weight: 600; font-weight: 600;
color: #251B1D; color: #251B1D;
margin-top: 12px; padding: 20rpx 0;
}
.file_box_big{
font-weight: 400;
color: #AFADB0;
} }
} }
} }
} }
</style> </style>

View File

@ -14,10 +14,11 @@
export default { export default {
data() { data() {
return { return {
list: [{ list: [
imgUrl: '../../static/icon7.png', // {
label: '文艺援助' // imgUrl: '../../static/icon7.png',
}, // label: ''
// },
{ {
imgUrl: '../../static/icon8.png', imgUrl: '../../static/icon8.png',
label: '媒体宣传' label: '媒体宣传'
@ -26,10 +27,10 @@
imgUrl: '../../static/moreFun/moreFun3.png', imgUrl: '../../static/moreFun/moreFun3.png',
label: '机构设置' label: '机构设置'
}, },
{ // {
imgUrl: '../../static/moreFun/moreFun4.png', // imgUrl: '../../static/moreFun/moreFun4.png',
label: '资料查找' // label: ''
}, // },
{ {
imgUrl: '../../static/moreFun/moreFun2.png', imgUrl: '../../static/moreFun/moreFun2.png',
label: '文艺下乡' label: '文艺下乡'
@ -40,57 +41,48 @@
{ {
imgUrl: '../../static/icon4.png', imgUrl: '../../static/icon4.png',
label: '线上看展' label: '线上看展'
}, }
// {
// imgUrl: '../../static/icon5.png',
// label: ''
// },
] ]
}; };
}, },
methods: { methods: {
SwitchPage(id) { SwitchPage(id) {
switch (id) { switch (id) {
// case 0:
// uni.navigateTo({
// url: "/pagesC/literHelp/literHelp"
// })
// break;
case 0: case 0:
uni.navigateTo({
url: "/pagesC/literHelp/literHelp"
})
break;
case 1:
uni.navigateTo({ uni.navigateTo({
url: "/pagesC/mediaProp/mediaProp" url: "/pagesC/mediaProp/mediaProp"
}) })
break; break;
case 2: case 1:
uni.navigateTo({ uni.navigateTo({
url: "/pagesD/jgsz/index" url: "/pagesD/jgsz/index"
}) })
break; break;
case 3: // case 3:
uni.navigateTo({ // uni.navigateTo({
url: "/pagesC/DataSearch/DataSearch" // url: "/pagesC/DataSearch/DataSearch"
}) // })
break; // break;
case 4: case 2:
uni.navigateTo({ uni.navigateTo({
url: "/pagesD/wyxx/index" url: "/pagesD/wyxx/index"
}) })
break; break;
case 5: case 3:
uni.navigateTo({ uni.navigateTo({
url: "/pagesB/ArtRace/ArtRace" url: "/pagesB/ArtRace/ArtRace"
}) })
break; break;
case 6: case 4:
uni.navigateTo({ uni.navigateTo({
url: "/pagesD/xskz/index" url: "/pagesD/xskz/index"
}) })
break; break;
case 7:
uni.redirectTo({
url: "/pagesC/shop/Shop?typesOf=3"
})
break;
} }
} }
} }

View File

@ -5,9 +5,9 @@
export default { export default {
config: { config: {
// baseUrl: "http://192.168.2.48:8080/h5/api", //俞燕红-小程序不能配跨域 baseUrl: "http://192.168.2.48:8080/h5/api", //俞燕红-小程序不能配跨域
// baseUrl: "/pre", //俞燕红-跨域 // baseUrl: "/pre", //俞燕红-跨域
baseUrl: "https://yxx.ydool.net/h5/api", //线上 // baseUrl: "https://yxx.ydool.net/h5/api", //线上
// baseUrl: "/h5/api", //h5 // baseUrl: "/h5/api", //h5
header: { header: {
'Content-Type': 'application/json;charset=UTF-8', 'Content-Type': 'application/json;charset=UTF-8',