Commit 67472b4e by 李伟康

提交代码

1 parent 62e87100
// components/UserInfo/UserInfo.js
import { componentsMixin } from '../../mixins/index'
import {
componentsMixin
} from '../../mixins/index'
Component({
behaviors:[componentsMixin],
behaviors: [componentsMixin],
/**
* 组件的属性列表
*/
properties: {
},
properties: {},
/**
* 组件的初始数据
*/
......@@ -27,6 +28,10 @@ Component({
console.log(this.data.showWechant)
},
addPhone() {
let _this = this,
{
clickCount
} = this.data
wx.addPhoneContact({
firstName: '石文',
mobilePhoneNumber: '13274150220',
......@@ -35,13 +40,17 @@ Component({
workAddressCountry: '中国',
workAddressState: '广东省',
workAddressCity: '深圳市',
workAddressStreet: '留仙大道3370号'
})
},
/**打开授权设置 */
authAddress() {
this.setData({
showAuth: true
workAddressStreet: '留仙大道3370号',
fail({
errMsg
}) {
if (clickCount) _this.setData({
showAuth: errMsg == 'addPhoneContact:fail auth deny'
})
else _this.setData({
clickCount: 1
})
}
})
},
/**授权位置成功 */
......
......@@ -34,14 +34,9 @@
<image class="icon-dial" webp src="{{IMGURL}}home/icon-dial.png"></image>
<view class="phone-text">拨打电话</view>
</view>
<block wx:if="{{unauthorized}}">
<button class="btn-plain btn" bindtap="authAddress">保存名片</button>
</block>
<block wx:else>
<button class="btn-plain btn" bindtap="addPhone">保存名片</button>
</block>
<button class="btn-plain btn" bindtap="addPhone">保存名片</button>
<button class="btn-primary btn" open-type="share">分享名片</button>
</view>
</view>
<authorize scopeType="addPhoneContact" bindsuccess="authSuccess" bindfail="authFail" show="{{showAuth}}" isShowCheck="{{false}}">
<authorize buttonType="openSetting" show="{{showAuth}}" isShowCheck="{{false}}">
</authorize>
\ No newline at end of file
......@@ -10,7 +10,7 @@
"enhance": true,
"postcss": true,
"preloadBackgroundData": false,
"minified": false,
"minified": true,
"newFeature": false,
"coverView": true,
"nodeModules": false,
......
......@@ -2,8 +2,9 @@
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "ai-card",
"setting": {
"compileHotReLoad": true,
"urlCheck": false
"compileHotReLoad": false,
"urlCheck": false,
"preloadBackgroundData": false
},
"condition": {
"miniprogram": {
......@@ -47,5 +48,6 @@
}
]
}
}
},
"libVersion": "2.25.4"
}
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!