Commit 865c2515 by 潘琦

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

parent ddc2b834
......@@ -8,7 +8,7 @@ const url = 'http://voucher.check.icaremgt.com' // 开发
// const sjkgurl = 'https://api-wx-service.check.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 = {
dev: {
......
......@@ -20,6 +20,7 @@
"qrcodejs2": "0.0.2",
"vue": "^2.5.2",
"vue-router": "^3.0.1",
"vue-signature": "^2.4.3",
"vuex": "^3.1.1",
"weixin-js-sdk": "^1.4.0-test"
},
......
......@@ -8,8 +8,14 @@
</template>
<script>
// import { wxpermission } from '@/wxpermission'
export default {
name: 'App'
name: 'App',
created () {
// wxpermission()
},
mounted: function () {
}
}
</script>
<style>
......@@ -406,6 +412,9 @@ ul li {
font-size: 0.9em;
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 {
width: 1em;
font-size: 0.9em;
......
......@@ -73,7 +73,7 @@ export default {
text-align:center;
}
.card-item > .card-item-content > .card-item-table > .price .label {
font-size: 2.3em;
font-size: 2.2em;
font-weight: bold;
color:#43d1be;
padding: 0;
......
......@@ -31,7 +31,7 @@ axios.interceptors.request.use(config => {
// respone拦截器
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
console.log('response status:' + status)
if (status !== 200) {
......@@ -61,6 +61,12 @@ axios.interceptors.response.use(response => {
window.location.href = 'http://' + location.host + '/#/recommend/list'
}, 4 * 1000)
}
} else if (status === 404) {
Toast({
message: res.data.error,
position: 'center',
duration: 3 * 1000
})
} else {
return Promise.reject(new Error(res.msg))
}
......
......@@ -31,7 +31,7 @@ axios.interceptors.request.use(config => {
// respone拦截器
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
console.log('response status:' + status)
if (status !== 200) {
......
......@@ -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 = 'http://192.168.1.234:9005'
// const sjkgUrl = 'http://192.168.1.234:9005'
const defaultUrl = {
authUrl: authUrl,
......
......@@ -24,8 +24,8 @@
// import { getUserCard, getunUsedCountById } from '@/api/apply/apply'
import { getContentInfo } from '@/api/apply/apply'
import defaultOrgImg from '../../assets/images/org-default-picture.png'
import { wxpermission } from '@/wxpermission'
const wx = require('weixin-js-sdk')
import { wxpermission, initWXShare } from '@/wxpermission'
import { getParamsByUrl, removeUrlParam } from '@/util/index'
export default {
name: 'Home',
......@@ -44,6 +44,7 @@ export default {
this.getContentInfoFn(this.imprId)
},
mounted: function () {
wxpermission(1, () => {})
},
computed: {
},
......@@ -61,43 +62,21 @@ export default {
producerOrgName: res.data.producerOrgName,
content: res.data.content,
mainTitle: res.data.mainTitle,
subheading: res.data.subheading
subheading: res.data.subheading,
cover: res.data.cover
}
console.log('getContentInfo')
wxpermission(() => {
const shareData = {
title: this.data.mainTitle,
imgUrl: this.data.producerPicUrl,
desc: this.data.subheading,
link: window.location.href
}
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 () {
// 用户取消分享后执行的回调函数
}
})
})
let that = this
let newShareLink = removeUrlParam('code')
let params = getParamsByUrl(window.location.href)
newShareLink = newShareLink.split('#')[0] + '#/content?imprId=' + params.imprId
const shareData = {
title: that.data.mainTitle,
imgUrl: that.data.cover,
desc: that.data.subheading !== '' ? that.data.subheading : '凯歌健康券',
link: newShareLink
}
initWXShare(shareData)
}
}).catch((error) => {
this.$toast({
......
......@@ -30,7 +30,7 @@
<div class="tr">
<div class="td label">姓名</div>
<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>
</div>
</div>
......@@ -55,16 +55,16 @@
<div class="tr" v-if="userData.role===1">
<div class="td label">身份证号</div>
<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>
</div>
</div>
<div class="tr" v-if="userData.role===1">
<div class="td label">性别</div>
<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
v-if="!memberId"
v-if="!userId"
v-model="userData.sex"
:options="['女孩', '男孩']"
@change="pictureChange">
......@@ -91,8 +91,8 @@
</div>
</div>
<div class="footer">
<a class="btn-link" v-if="memberId" @click="delMember">删除家庭成员</a>
<button v-if="!memberId" class="btn-orange btn-block" :class="btnDisabled?'disabled':''" :disabled="btnDisabled" @click="handelSave">保存</button>
<a class="btn-link" v-if="userId" @click="delMember">删除家庭成员</a>
<button v-if="!userId" class="btn-orange btn-block" :class="btnDisabled?'disabled':''" :disabled="btnDisabled" @click="handelSave">保存</button>
</div>
</div>
</div>
......@@ -140,13 +140,13 @@ export default {
name: 'member',
data () {
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,
pageType: this.$route.query.type ? parseInt(this.$route.query.type) : null, // 1=子女 2=配偶 3=父母
picture: _iconBoy,
userData: {
name: '',
role: parseInt(this.$route.query.type),
role: this.$route.query.type ? parseInt(this.$route.query.type) : 1,
sex: '男孩',
birth: '',
idCard: '',
......@@ -181,8 +181,8 @@ export default {
method: that.selectedRole2
}]
console.log('member edit')
if (this.memberId) {
this.getUserInfoByIdFn(this.memberId) // 根据用户id获取该成员信息(成员编辑)
if (this.userId) {
this.getUserInfoByIdFn(this.userId) // 根据用户id获取该成员信息(成员编辑)
}
},
mounted: function () {
......@@ -204,7 +204,7 @@ export default {
this.userData.idCardKid = data.skuNumber
this.userData.birth = data.birth
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) {
this.userData.idCard = data.skuNumber
this.userData.lastMensesTime = data.lastMensesTime
......@@ -219,7 +219,7 @@ export default {
})
},
roleActionSheet () {
if (!this.memberId) {
if (!this.userId) {
this.roleSheetVisible = true
}
},
......@@ -242,7 +242,9 @@ export default {
}
},
openPickerBirth () { // 打开出生日期控件
this.$refs.pickerBirth.open()
if (!this.userId) {
this.$refs.pickerBirth.open()
}
},
birthPickerConfirm (date) { // 出生日期控件“确认”事件
const selectedDate = new Date(date)
......
......@@ -145,7 +145,7 @@ export default {
this.$router.push({
path: '/member/edit',
query: {
userId: this.mainData.id,
memberId: this.mainData.id,
type: _type,
id: _id
}
......@@ -155,7 +155,7 @@ export default {
this.$router.push({
path: '/member/edit',
query: {
userId: this.userId
memberId: this.mainData.id
}
})
}
......
......@@ -22,6 +22,10 @@
<div class="text-center">{{voucherData.voucherName}}</div>
<div class="table">
<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 text-left">{{voucherData.useStartTime && voucherData.useStartTime !== "" ? voucherData.useStartTime.split(" ")[0] : ""}} - {{voucherData.useEndTime && voucherData.useEndTime !== "" ? voucherData.useEndTime.split(" ")[0]:""}}</div>
</div>
......@@ -325,8 +329,9 @@ export default {
vertical-align: top;
}
.detail-card .body .table .tr > .td.label{
width: 3em;
width: 5em;
font-size: 1em;
font-weight:bold;
text-align: right;
}
</style>
import { WXconfirm } from '@/api/wxconfirm'
import store from '@/store'
import { removeUrlParam } from '@/util/index'
const wx = require('weixin-js-sdk')
export const wxpermission = (fn) => {
export const wxpermission = (state, fn) => {
console.log('微信鉴权')
console.log(window.location.href)
WXconfirm({
......@@ -20,9 +21,47 @@ export const wxpermission = (fn) => {
})
wx.ready(() => {
fn()
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
})
if (state === 0) {
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
})
}
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