1.首先你要有一个可以就行人脸识别的服务器,然后就是上传到百度云,百度云人脸识别的API接口全面升级到V3版本,并进行开放测试
2.wxml代码
- <camera device-position="{ {sxt}}" flash="off" binderror="error" style="width: 100%; height: 300px;"></camera>
- <view class="weui-cells weui-cells_after-title">
- <view class="weui-cell weui-cell_switch">
- <view class="weui-cell__bd"></view>
- <!-- <view class="weui-cell__ft"> -->
- <input name='sex' value='{ {sxt}}'>{ {sxt}}</input>
- <switch checked bindchange='switch1Change'/>
- <!-- </view> -->
- </view>
- </view>
- <button type="primary" bindtap="takePhoto">拍照</button>
3.js代码
- data: {