diff --git a/秦皇岛四院小程序/lu/share.js b/秦皇岛四院小程序/lu/share.js new file mode 100644 index 0000000..9e515a7 --- /dev/null +++ b/秦皇岛四院小程序/lu/share.js @@ -0,0 +1,26 @@ +export default { + data() { + return {} + }, + //分享小程序 + onShareAppMessage(e) { + if (e.from === 'button') { + console.log('来自页面内转发按钮'); + } else if (e.from === 'menu') { + console.log('右上角菜单转发按钮'); + } + return { + // 自定义分享内容 + title: '大庆普济', + path: '/pages/main/home/home', // 路径,可传递参数到指定页面 + + }; + }, + // 分享到朋友圈 + onShareTimeline() { + return { + title: '大庆普济', + path: '/pages/main/home/home', + }; + }, +} diff --git a/秦皇岛四院小程序/main.js b/秦皇岛四院小程序/main.js index 04ab6c3..336ef03 100644 --- a/秦皇岛四院小程序/main.js +++ b/秦皇岛四院小程序/main.js @@ -4,10 +4,12 @@ import { import * as Pinia from 'pinia'; import App from './App.vue' import $lu from './lu' +import share from './lu/share.js' //注意路径是上一步新建文件的路径 uni.$lu = $lu export function createApp() { const app = createSSRApp(App) + app.mixin(share) app.use(Pinia.createPinia()) return { app, diff --git a/秦皇岛四院小程序/pages/buy/info/info.vue b/秦皇岛四院小程序/pages/buy/info/info.vue index 13b4dc0..3cde5c1 100644 --- a/秦皇岛四院小程序/pages/buy/info/info.vue +++ b/秦皇岛四院小程序/pages/buy/info/info.vue @@ -201,7 +201,7 @@ {{ k+1 }}.{{ i.name }} - ¥{{ Number(i.price).toFixed(2) }} + @@ -218,7 +218,7 @@ {{ k+1 }}.{{ i.name }} - ¥{{ Number(i.price).toFixed(2) }} +