Commit 67472b4e by 李伟康

提交代码

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