Commit 865c2515 by 潘琦

张家港需求代码更新及完善;

parent ddc2b834
...@@ -8,7 +8,7 @@ const url = 'http://voucher.check.icaremgt.com' // 开发 ...@@ -8,7 +8,7 @@ const url = 'http://voucher.check.icaremgt.com' // 开发
// const sjkgurl = 'https://api-wx-service.check.icaremgt.com' // 机构空间(开发) // const sjkgurl = 'https://api-wx-service.check.icaremgt.com' // 机构空间(开发)
// const sjkgurl = 'https://sjkg-wx-service.icaremgt.com' // 机构空间(正式) // const sjkgurl = 'https://sjkg-wx-service.icaremgt.com' // 机构空间(正式)
const sjkgurl = 'http://192.168.1.234:9005' const sjkgurl = 'http://192.168.1.169:9005'
module.exports = { module.exports = {
dev: { dev: {
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
"qrcodejs2": "0.0.2", "qrcodejs2": "0.0.2",
"vue": "^2.5.2", "vue": "^2.5.2",
"vue-router": "^3.0.1", "vue-router": "^3.0.1",
"vue-signature": "^2.4.3",
"vuex": "^3.1.1", "vuex": "^3.1.1",
"weixin-js-sdk": "^1.4.0-test" "weixin-js-sdk": "^1.4.0-test"
}, },
......
...@@ -8,8 +8,14 @@ ...@@ -8,8 +8,14 @@
</template> </template>
<script> <script>
// import { wxpermission } from '@/wxpermission'
export default { export default {
name: 'App' name: 'App',
created () {
// wxpermission()
},
mounted: function () {
}
} }
</script> </script>
<style> <style>
...@@ -406,6 +412,9 @@ ul li { ...@@ -406,6 +412,9 @@ ul li {
font-size: 0.9em; font-size: 0.9em;
color:#9aa0a4; color:#9aa0a4;
} }
.form > .table > .tr > .td .td-table > .td-table-cell.text .light {
color:#333;
}
.form > .table > .tr > .td .td-table > .td-table-cell.icon { .form > .table > .tr > .td .td-table > .td-table-cell.icon {
width: 1em; width: 1em;
font-size: 0.9em; font-size: 0.9em;
......
...@@ -73,7 +73,7 @@ export default { ...@@ -73,7 +73,7 @@ export default {
text-align:center; text-align:center;
} }
.card-item > .card-item-content > .card-item-table > .price .label { .card-item > .card-item-content > .card-item-table > .price .label {
font-size: 2.3em; font-size: 2.2em;
font-weight: bold; font-weight: bold;
color:#43d1be; color:#43d1be;
padding: 0; padding: 0;
......
...@@ -31,7 +31,7 @@ axios.interceptors.request.use(config => { ...@@ -31,7 +31,7 @@ axios.interceptors.request.use(config => {
// respone拦截器 // respone拦截器
axios.interceptors.response.use(response => { axios.interceptors.response.use(response => {
const res = response.data && response.data.code === 0 ? response.data : response const res = response.data && (response.data.code === 0 || response.data.code === 200) ? response.data : response
const status = Number(response.status) || 200 const status = Number(response.status) || 200
console.log('response status:' + status) console.log('response status:' + status)
if (status !== 200) { if (status !== 200) {
...@@ -61,6 +61,12 @@ axios.interceptors.response.use(response => { ...@@ -61,6 +61,12 @@ axios.interceptors.response.use(response => {
window.location.href = 'http://' + location.host + '/#/recommend/list' window.location.href = 'http://' + location.host + '/#/recommend/list'
}, 4 * 1000) }, 4 * 1000)
} }
} else if (status === 404) {
Toast({
message: res.data.error,
position: 'center',
duration: 3 * 1000
})
} else { } else {
return Promise.reject(new Error(res.msg)) return Promise.reject(new Error(res.msg))
} }
......
...@@ -31,7 +31,7 @@ axios.interceptors.request.use(config => { ...@@ -31,7 +31,7 @@ axios.interceptors.request.use(config => {
// respone拦截器 // respone拦截器
axios.interceptors.response.use(response => { axios.interceptors.response.use(response => {
const res = response.data && response.data.code === 200 ? response.data : response const res = response.data && (response.data.code === 0 || response.data.code === 200) ? response.data : response
const status = Number(response.status) || 200 const status = Number(response.status) || 200
console.log('response status:' + status) console.log('response status:' + status)
if (status !== 200) { if (status !== 200) {
......
...@@ -13,9 +13,9 @@ const baseUrl = '"http://voucher.check.icaremgt.com"' // 开发 ...@@ -13,9 +13,9 @@ const baseUrl = '"http://voucher.check.icaremgt.com"' // 开发
/** /**
* 机构控件项目接口请求地址 * 机构控件项目接口请求地址
*/ */
// const sjkgUrl = 'https://api-wx-service.check.icaremgt.com' // 开发 const sjkgUrl = 'https://api-wx-service.check.icaremgt.com' // 开发
// const sjkgUrl = 'https://sjkg-wx-service.icaremgt.com' // 正式 // const sjkgUrl = 'https://sjkg-wx-service.icaremgt.com' // 正式
const sjkgUrl = 'http://192.168.1.234:9005' // const sjkgUrl = 'http://192.168.1.234:9005'
const defaultUrl = { const defaultUrl = {
authUrl: authUrl, authUrl: authUrl,
......
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
// import { getUserCard, getunUsedCountById } from '@/api/apply/apply' // import { getUserCard, getunUsedCountById } from '@/api/apply/apply'
import { getContentInfo } from '@/api/apply/apply' import { getContentInfo } from '@/api/apply/apply'
import defaultOrgImg from '../../assets/images/org-default-picture.png' import defaultOrgImg from '../../assets/images/org-default-picture.png'
import { wxpermission } from '@/wxpermission' import { wxpermission, initWXShare } from '@/wxpermission'
const wx = require('weixin-js-sdk') import { getParamsByUrl, removeUrlParam } from '@/util/index'
export default { export default {
name: 'Home', name: 'Home',
...@@ -44,6 +44,7 @@ export default { ...@@ -44,6 +44,7 @@ export default {
this.getContentInfoFn(this.imprId) this.getContentInfoFn(this.imprId)
}, },
mounted: function () { mounted: function () {
wxpermission(1, () => {})
}, },
computed: { computed: {
}, },
...@@ -61,43 +62,21 @@ export default { ...@@ -61,43 +62,21 @@ export default {
producerOrgName: res.data.producerOrgName, producerOrgName: res.data.producerOrgName,
content: res.data.content, content: res.data.content,
mainTitle: res.data.mainTitle, mainTitle: res.data.mainTitle,
subheading: res.data.subheading subheading: res.data.subheading,
cover: res.data.cover
} }
console.log('getContentInfo') console.log('getContentInfo')
wxpermission(() => { let that = this
let newShareLink = removeUrlParam('code')
let params = getParamsByUrl(window.location.href)
newShareLink = newShareLink.split('#')[0] + '#/content?imprId=' + params.imprId
const shareData = { const shareData = {
title: this.data.mainTitle, title: that.data.mainTitle,
imgUrl: this.data.producerPicUrl, imgUrl: that.data.cover,
desc: this.data.subheading, desc: that.data.subheading !== '' ? that.data.subheading : '凯歌健康券',
link: window.location.href link: newShareLink
}
wx.onMenuShareAppMessage({
title: shareData.title, // 分享标题
desc: shareData.desc, // 分享描述
link: shareData.link, // 分享链接
imgUrl: shareData.imgUrl, // 分享图标
type: 'link', // 分享类型,music、video或link,不填默认为link
dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空
success: function () {
// 用户确认分享后执行的回调函数
},
cancel: function () {
// 用户取消分享后执行的回调函数
}
})
wx.onMenuShareTimeline({
title: shareData.title, // 分享标题
desc: shareData.desc, // 分享描述
link: shareData.link, // 分享链接
imgUrl: shareData.imgUrl, // 分享图标
success: function () {
// 用户确认分享后执行的回调函数
},
cancel: function () {
// 用户取消分享后执行的回调函数
} }
}) initWXShare(shareData)
})
} }
}).catch((error) => { }).catch((error) => {
this.$toast({ this.$toast({
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<div class="tr"> <div class="tr">
<div class="td label">姓名</div> <div class="td label">姓名</div>
<div class="td text-right"> <div class="td text-right">
<input type="text" class="form-control" v-model="userData.name" @blur="BaseValidateName" :disabled="memberId" placeholder="请输入姓名"/> <input type="text" class="form-control" v-model="userData.name" @blur="BaseValidateName" :disabled="userId" placeholder="请输入姓名"/>
<span v-show="!BaseValidate.nameState" class="small-hint">(只能是中文或英文,长度1~15位)</span> <span v-show="!BaseValidate.nameState" class="small-hint">(只能是中文或英文,长度1~15位)</span>
</div> </div>
</div> </div>
...@@ -55,16 +55,16 @@ ...@@ -55,16 +55,16 @@
<div class="tr" v-if="userData.role===1"> <div class="tr" v-if="userData.role===1">
<div class="td label">身份证号</div> <div class="td label">身份证号</div>
<div class="td text-right"> <div class="td text-right">
<input type="text" class="form-control" placeholder="请输入子女有效身份证" v-model="userData.idCardKid"/> <input type="text" class="form-control" placeholder="请输入子女有效身份证" v-model="userData.idCardKid" :disabled="userId"/>
<span v-show="!BaseValidate.idCardKidState" class="small-hint">请输入子女有效身份证</span> <span v-show="!BaseValidate.idCardKidState" class="small-hint">请输入子女有效身份证</span>
</div> </div>
</div> </div>
<div class="tr" v-if="userData.role===1"> <div class="tr" v-if="userData.role===1">
<div class="td label">性别</div> <div class="td label">性别</div>
<div class="td text-right"> <div class="td text-right">
<input type="text" v-if="memberId" disabled class="form-control" v-model="userData.sex"/> <input type="text" v-if="userId" disabled class="form-control" v-model="userData.sex"/>
<mt-radio <mt-radio
v-if="!memberId" v-if="!userId"
v-model="userData.sex" v-model="userData.sex"
:options="['女孩', '男孩']" :options="['女孩', '男孩']"
@change="pictureChange"> @change="pictureChange">
...@@ -91,8 +91,8 @@ ...@@ -91,8 +91,8 @@
</div> </div>
</div> </div>
<div class="footer"> <div class="footer">
<a class="btn-link" v-if="memberId" @click="delMember">删除家庭成员</a> <a class="btn-link" v-if="userId" @click="delMember">删除家庭成员</a>
<button v-if="!memberId" class="btn-orange btn-block" :class="btnDisabled?'disabled':''" :disabled="btnDisabled" @click="handelSave">保存</button> <button v-if="!userId" class="btn-orange btn-block" :class="btnDisabled?'disabled':''" :disabled="btnDisabled" @click="handelSave">保存</button>
</div> </div>
</div> </div>
</div> </div>
...@@ -140,13 +140,13 @@ export default { ...@@ -140,13 +140,13 @@ export default {
name: 'member', name: 'member',
data () { data () {
return { return {
memberId: this.$route.query.userId ? parseInt(this.$route.query.userId) : null, memberId: this.$route.query.memberId ? parseInt(this.$route.query.memberId) : null,
userId: this.$route.query.id ? parseInt(this.$route.query.id) : null, userId: this.$route.query.id ? parseInt(this.$route.query.id) : null,
pageType: this.$route.query.type ? parseInt(this.$route.query.type) : null, // 1=子女 2=配偶 3=父母 pageType: this.$route.query.type ? parseInt(this.$route.query.type) : null, // 1=子女 2=配偶 3=父母
picture: _iconBoy, picture: _iconBoy,
userData: { userData: {
name: '', name: '',
role: parseInt(this.$route.query.type), role: this.$route.query.type ? parseInt(this.$route.query.type) : 1,
sex: '男孩', sex: '男孩',
birth: '', birth: '',
idCard: '', idCard: '',
...@@ -181,8 +181,8 @@ export default { ...@@ -181,8 +181,8 @@ export default {
method: that.selectedRole2 method: that.selectedRole2
}] }]
console.log('member edit') console.log('member edit')
if (this.memberId) { if (this.userId) {
this.getUserInfoByIdFn(this.memberId) // 根据用户id获取该成员信息(成员编辑) this.getUserInfoByIdFn(this.userId) // 根据用户id获取该成员信息(成员编辑)
} }
}, },
mounted: function () { mounted: function () {
...@@ -204,7 +204,7 @@ export default { ...@@ -204,7 +204,7 @@ export default {
this.userData.idCardKid = data.skuNumber this.userData.idCardKid = data.skuNumber
this.userData.birth = data.birth this.userData.birth = data.birth
this.userData.sex = data.sex === 1 ? '男孩' : data.sex === 2 ? '女孩' : '' this.userData.sex = data.sex === 1 ? '男孩' : data.sex === 2 ? '女孩' : ''
this.picture = data.sex === 1 ? _iconBoy : data.sex === _iconGirl ? _iconWoman : _iconMan this.picture = data.sex === 1 ? _iconBoy : data.sex === 2 ? _iconGirl : _iconMan
} else if (this.pageType === 2) { } else if (this.pageType === 2) {
this.userData.idCard = data.skuNumber this.userData.idCard = data.skuNumber
this.userData.lastMensesTime = data.lastMensesTime this.userData.lastMensesTime = data.lastMensesTime
...@@ -219,7 +219,7 @@ export default { ...@@ -219,7 +219,7 @@ export default {
}) })
}, },
roleActionSheet () { roleActionSheet () {
if (!this.memberId) { if (!this.userId) {
this.roleSheetVisible = true this.roleSheetVisible = true
} }
}, },
...@@ -242,7 +242,9 @@ export default { ...@@ -242,7 +242,9 @@ export default {
} }
}, },
openPickerBirth () { // 打开出生日期控件 openPickerBirth () { // 打开出生日期控件
if (!this.userId) {
this.$refs.pickerBirth.open() this.$refs.pickerBirth.open()
}
}, },
birthPickerConfirm (date) { // 出生日期控件“确认”事件 birthPickerConfirm (date) { // 出生日期控件“确认”事件
const selectedDate = new Date(date) const selectedDate = new Date(date)
......
...@@ -145,7 +145,7 @@ export default { ...@@ -145,7 +145,7 @@ export default {
this.$router.push({ this.$router.push({
path: '/member/edit', path: '/member/edit',
query: { query: {
userId: this.mainData.id, memberId: this.mainData.id,
type: _type, type: _type,
id: _id id: _id
} }
...@@ -155,7 +155,7 @@ export default { ...@@ -155,7 +155,7 @@ export default {
this.$router.push({ this.$router.push({
path: '/member/edit', path: '/member/edit',
query: { query: {
userId: this.userId memberId: this.mainData.id
} }
}) })
} }
......
...@@ -22,6 +22,10 @@ ...@@ -22,6 +22,10 @@
<div class="text-center">{{voucherData.voucherName}}</div> <div class="text-center">{{voucherData.voucherName}}</div>
<div class="table"> <div class="table">
<div class="tr"> <div class="tr">
<div class="td label">领取人:</div>
<div class="td text-left">{{voucherData.userName}}</div>
</div>
<div class="tr">
<div class="td label">可用时间:</div> <div class="td label">可用时间:</div>
<div class="td text-left">{{voucherData.useStartTime && voucherData.useStartTime !== "" ? voucherData.useStartTime.split(" ")[0] : ""}} - {{voucherData.useEndTime && voucherData.useEndTime !== "" ? voucherData.useEndTime.split(" ")[0]:""}}</div> <div class="td text-left">{{voucherData.useStartTime && voucherData.useStartTime !== "" ? voucherData.useStartTime.split(" ")[0] : ""}} - {{voucherData.useEndTime && voucherData.useEndTime !== "" ? voucherData.useEndTime.split(" ")[0]:""}}</div>
</div> </div>
...@@ -325,8 +329,9 @@ export default { ...@@ -325,8 +329,9 @@ export default {
vertical-align: top; vertical-align: top;
} }
.detail-card .body .table .tr > .td.label{ .detail-card .body .table .tr > .td.label{
width: 3em; width: 5em;
font-size: 1em; font-size: 1em;
font-weight:bold; font-weight:bold;
text-align: right;
} }
</style> </style>
import { WXconfirm } from '@/api/wxconfirm' import { WXconfirm } from '@/api/wxconfirm'
import store from '@/store' import store from '@/store'
import { removeUrlParam } from '@/util/index'
const wx = require('weixin-js-sdk') const wx = require('weixin-js-sdk')
export const wxpermission = (fn) => { export const wxpermission = (state, fn) => {
console.log('微信鉴权') console.log('微信鉴权')
console.log(window.location.href) console.log(window.location.href)
WXconfirm({ WXconfirm({
...@@ -20,9 +21,47 @@ export const wxpermission = (fn) => { ...@@ -20,9 +21,47 @@ export const wxpermission = (fn) => {
}) })
wx.ready(() => { wx.ready(() => {
fn() fn()
if (state === 0) {
wx.hideMenuItems({ wx.hideMenuItems({
menuList: ['menuItem:share:appMessage', 'menuItem:share:timeline', 'menuItem:copyUrl', 'menuItem:share:qq', 'menuItem:share:weiboApp', 'menuItem:favorite', 'menuItem:share:facebook', 'menuItem:share:QZone', 'menuItem:originPage', 'menuItem:openWithQQBrowser', 'menuItem:openWithSafari', 'menuItem:share:email', 'menuItem:share:brand', 'menuItem:editTag'] // 要隐藏的菜单项,只能隐藏“传播类”和“保护类”按钮,所有menu项见附录3 menuList: ['menuItem:share:appMessage', 'menuItem:share:timeline', 'menuItem:copyUrl', 'menuItem:share:qq', 'menuItem:share:weiboApp', 'menuItem:favorite', 'menuItem:share:facebook', 'menuItem:share:QZone', 'menuItem:originPage', 'menuItem:openWithQQBrowser', 'menuItem:openWithSafari', 'menuItem:share:email', 'menuItem:share:brand', 'menuItem:editTag'] // 要隐藏的菜单项,只能隐藏“传播类”和“保护类”按钮,所有menu项见附录3
}) })
}
const shareData = {
title: '凯歌健康券',
imgUrl: 'http://www.icaremgt.com/img/logo_03.png',
desc: '致力于各个服务机构与用户',
link: removeUrlParam('code')
}
initWXShare(shareData)
}) })
}) })
} }
export const initWXShare = (shareData) => {
wx.onMenuShareAppMessage({
title: shareData.title, // 分享标题
desc: shareData.desc, // 分享描述
link: shareData.link, // 分享链接
imgUrl: shareData.imgUrl, // 分享图标
type: 'link', // 分享类型,music、video或link,不填默认为link
dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空
success: function () {
// 用户确认分享后执行的回调函数
},
cancel: function () {
// 用户取消分享后执行的回调函数
}
})
wx.onMenuShareTimeline({
title: shareData.title, // 分享标题
desc: shareData.desc, // 分享描述
link: shareData.link, // 分享链接
imgUrl: shareData.imgUrl, // 分享图标
success: function () {
// 用户确认分享后执行的回调函数
},
cancel: function () {
// 用户取消分享后执行的回调函数
}
})
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment