unknown 11 months ago
parent
commit
476301b8f9
  1. 4
      manifest.json
  2. 1
      package.json
  3. 4
      pages/tabbar/mine/index.vue
  4. 30
      pages/userCenter/scanCode/scanCode.vue

4
manifest.json

@ -78,11 +78,11 @@
"vueVersion" : "2",
"h5" : {
"devServer" : {
"port" : 8000,
"port" : 91,
"disableHostCheck" : true,
"proxy" : {
"/api" : {
"target" : "http://192.168.1.39:48080/",
"target" : "http://192.168.1.36:48080/",
"changeOrigin" : true,
"secure" : true,
"pathRewrite" : {

1
package.json

@ -10,6 +10,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"uqrcodejs": "^4.0.7",
"uview-ui": "^2.0.36"
}
}

4
pages/tabbar/mine/index.vue

@ -27,7 +27,7 @@
</view>
</view>
<u-action-sheet :actions="list" title="请选择您要登录的角色" :show="showRole" @select="selectClick" ></u-action-sheet>
<u-action-sheet :actions="list" title="请选择您要登录的角色" :show="showRole" @select="selectClick" @close="showRole=false" ></u-action-sheet>
<UserTab name ='我的'></UserTab>
</view>
@ -105,7 +105,7 @@
this.list.push(obj)
})
},
goPage() {},
getIpAddress() {
// 使APIIPipinfo.io

30
pages/userCenter/scanCode/scanCode.vue

@ -4,7 +4,7 @@
<view class="pad">
<view class="card">
<view class="qcode">
<canvas id="qrcode" canvas-id="qrcode" style="width: 200px;height: 200px;"></canvas>
</view>
</view>
@ -16,12 +16,40 @@
</template>
<script>
import UQRCode from 'uqrcodejs';
export default {
onReady() {
// uQRCode
var qr = new UQRCode();
let {coachId, nickname, schoolId, tenantId} = this.vuex_userInfo.user
//
qr.data = JSON.stringify({
coachId,
schoolId,
nickname: encodeURIComponent(nickname)
})
// canvas
qr.size = 200;
qr.margin = 20;
//
qr.make();
// canvas
var canvasContext = uni.createCanvasContext('qrcode', this); // this
// uQRCodecanvas
qr.canvasContext = canvasContext;
// canvas
qr.drawCanvas();
}
}
</script>
<style lang="scss" scoped>
.qcode {
width: 100%;
height: 600rpx;
display: flex;
align-items: center;
justify-content: center;
}
.card {
padding: 28rpx;

Loading…
Cancel
Save