|
|
@@ -1,6 +1,4 @@
|
|
|
<script setup lang="ts">
|
|
|
-import router from '@/router'
|
|
|
-
|
|
|
definePage({
|
|
|
name: 'refueling-tabbar',
|
|
|
islogin: false,
|
|
|
@@ -9,14 +7,60 @@ definePage({
|
|
|
},
|
|
|
})
|
|
|
|
|
|
+onMounted(() => {
|
|
|
+ console.log('触发加载')
|
|
|
+ getPayQrcode()
|
|
|
+})
|
|
|
+
|
|
|
function refuelingPay() {
|
|
|
console.log('触发跳转')
|
|
|
- router.push({ name: 'refueling-webview' })
|
|
|
- // uni.navigateToMiniProgram({
|
|
|
- // appId: 'wx0d252f6ed9755862', // 滴滴加油小程序appId
|
|
|
- // path: 'packageA/pages/open-energy-pay/index?orderId=&tradeId=&appId=wx43b5b906cc30ed0b&path=/pages/index/index&envVersion=小程序回跳环境', // 滴滴加油收银台页面地址,需要拼接orderId和tradeId
|
|
|
- // envVersion: 'release', // 固定release
|
|
|
+ // router.push({ name: 'refueling-webview' })
|
|
|
+ // wx.openOfficialAccountArticle({
|
|
|
+ // url: 'https://smqjh.admin.zswlgz.com/test.html', // 此处填写公众号的原始 ID
|
|
|
+ // success: (res) => {
|
|
|
+ // },
|
|
|
+ // fail: (res) => {
|
|
|
+ // console.log(res, 'err')
|
|
|
+ // },
|
|
|
// })
|
|
|
+ uni.navigateToMiniProgram({
|
|
|
+ appId: 'wx0d252f6ed9755862', // 滴滴加油小程序appId
|
|
|
+ path: 'packageA/pages/open-energy-pay/index?orderId=&tradeId=&appId=wx43b5b906cc30ed0b&path=/pages/index/index&envVersion=小程序回跳环境', // 滴滴加油收银台页面地址,需要拼接orderId和tradeId
|
|
|
+ envVersion: 'release', // 固定release
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+const payQrCode = ref('')
|
|
|
+async function getPayQrcode() {
|
|
|
+ const res = await Apis.refueling.getPayCode({
|
|
|
+ data: {
|
|
|
+ content: 'https://static.am.xiaojukeji.com/cf-terminal/oil/thanos-fe-oil/pages/open-energy-h5-pay/index.html?orderId=3521815091021431239&tradeId=20260226b3dd729612c482ab35c26879ca59118a10560142',
|
|
|
+ },
|
|
|
+ })
|
|
|
+ payQrCode.value = res.data
|
|
|
+}
|
|
|
+function testClick() {
|
|
|
+ uni.previewImage({
|
|
|
+ // 需要预览的图片链接列表
|
|
|
+ urls: [payQrCode.value],
|
|
|
+ // 当前显示图片的链接
|
|
|
+ current: payQrCode.value,
|
|
|
+ // 图片指示器样式
|
|
|
+ indicator: 'default',
|
|
|
+ // 是否可循环预览
|
|
|
+ loop: false,
|
|
|
+ showmenu: true,
|
|
|
+ // 长按图片显示操作菜单
|
|
|
+ longPressActions: {
|
|
|
+ itemList: ['发送给朋友', '保存到相册', '识别图中二维码'],
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ console.log('previewImage res', res)
|
|
|
+ },
|
|
|
+ fail: (err) => {
|
|
|
+ console.log('previewImage err', err)
|
|
|
+ },
|
|
|
+ })
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
@@ -25,6 +69,7 @@ function refuelingPay() {
|
|
|
<wd-button @click="refuelingPay">
|
|
|
加油充值
|
|
|
</wd-button>
|
|
|
+ <image :src="payQrCode" @click="testClick" />
|
|
|
</view>
|
|
|
</template>
|
|
|
|