app 分享功能重写

This commit is contained in:
@fawn-nine
2023-10-09 14:04:04 +08:00
parent f226f44cbd
commit 4184ec9c36
6 changed files with 95 additions and 38 deletions

View File

@@ -238,7 +238,7 @@ export const getLatLon = function(tip) {
// 单独微信支付
export const setWXPay = function(payInfo, callback) {
$http.request({
url: "/pay/placeAnOrder/shoppingpay",
url: "/pay/placeAnOrder/shoppingPay",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data:payInfo,
header: { //默认 无 说明请求头1

View File

@@ -89,7 +89,7 @@
<!-- <view class="nav_list" @click="onGoing()">
<text>帮助与反馈11111</text>
</view> -->
<view class="nav_list" @click="onShare">
<view class="nav_list" @click="newOnShare">
<text>分享App</text>
</view>
<view class="nav_list" @click="onPageJump('../peanut/aboutUs')">
@@ -107,6 +107,11 @@
<u-modal :show="signShow" :content="signContent" :showCancelButton="true" @cancel="signShow=false"
@confirm="signOut">
</u-modal>
<!-- 分享弹窗 -->
<uni-popup ref="share" type="share" safeArea backgroundColor="#fff">
<uni-popup-share @select="haveSelected"></uni-popup-share>
</uni-popup>
<music-play :playData="playData"></music-play>
<z-navigation></z-navigation>
</view>
@@ -115,7 +120,7 @@
<script>
import musicPlay from '@/components/music.vue'
import $http from '@/config/requestConfig.js';
import appShare, { closeShare } from '@/uni_modules/zhouWei-APPshare/js_sdk/appShare';
// import appShare, { closeShare } from '@/uni_modules/zhouWei-APPshare/js_sdk/appShare';
import {
mapState
} from 'vuex';
@@ -148,6 +153,44 @@
},
//方法
methods: {
haveSelected(data){
console.log(data,' 选择的是')
if(data.index == 0){
// 分享到好友
uni.share({
provider: "weixin",
scene: "WXSceneSession",
type: 0,
href: "https://www.nuttyreading.com/nuttyreading.apk",
title: "疯子读书",
summary: "我正在使用疯子读书提升自己,赶紧跟我一起来体验吧!",
imageUrl: "static/fengziIcon.jpg",
success: function (res) {
console.log("success:" + JSON.stringify(res));
},
fail: function (err) {
console.log("fail:" + JSON.stringify(err));
}
});
}else if(data.index == 1){
// 分享到朋友圈
uni.share({
provider: "weixin",
scene: "WXSceneTimeline",
type: 0,
href: "https://www.nuttyreading.com/nuttyreading.apk",
title: "疯子读书",
summary: "我正在使用疯子读书提升自己,赶紧跟我一起来体验吧!",
imageUrl: "static/fengziIcon.jpg",
success: function (res) {
console.log("success:" + JSON.stringify(res));
},
fail: function (err) {
console.log("fail:" + JSON.stringify(err));
}
});
}
},
switchTab(url){
uni.switchTab({
url: url
@@ -170,32 +213,35 @@
},
//分享app
onShare(){
let shareData = {
shareUrl:"https://www.nuttyreading.com/nuttyreading.apk",
shareTitle:"疯子读书",
type:'0',
summary:'疯子读书,请使用浏览器打开本链接,自动下载安装包', // 分享内容的摘要
shareContent:"疯子读书,请使用浏览器打开本链接,自动下载安装包",
shareImg:"static/fengziIcon.jpg",
appId : "wx47134a8f15083734", // 默认不传type的时候必须传appId和appPath才会显示小程序图标
appPath : "https://www.nuttyreading.com/nuttyreading.apk",
appWebUrl : "https://www.nuttyreading.com/nuttyreading.apk",
};
// 调用
let shareObj = appShare(shareData,res => {
console.log("疯子读书",res);
// 分享成功后关闭弹窗
// 第一种关闭弹窗的方式
closeShare();
});
setTimeout(() => {
// 第二种关闭弹窗的方式
shareObj.close();
},5000);
// 新写分享
newOnShare(){
this.$refs.share.open()
},
//分享app
// onShare(){
// let shareData = {
// shareUrl:"https://www.nuttyreading.com/nuttyreading.apk",
// shareTitle:"疯子读书",
// type:'0',
// summary:'疯子读书,请使用浏览器打开本链接,自动下载安装包', // 分享内容的摘要
// shareContent:"疯子读书,请使用浏览器打开本链接,自动下载安装包",
// shareImg:"static/fengziIcon.jpg",
// appId : "wx47134a8f15083734", // 默认不传type的时候必须传appId和appPath才会显示小程序图标
// appPath : "https://www.nuttyreading.com/nuttyreading.apk",
// appWebUrl : "https://www.nuttyreading.com/nuttyreading.apk",
// };
// // 调用
// let shareObj = appShare(shareData,res => {
// console.log("疯子读书",res);
// // 分享成功后关闭弹窗
// // 第一种关闭弹窗的方式
// closeShare();
// });
// setTimeout(() => {
// // 第二种关闭弹窗的方式
// shareObj.close();
// },5000);
// },
// 注销账户
logout(){

View File

@@ -1,3 +1,5 @@
## 1.3.22023-05-04
- 修复 NVUE 平台报错的问题
## 1.3.12021-11-23
- 修复 init 方法初始化问题
## 1.3.02021-11-19

View File

@@ -10,7 +10,10 @@ const nvueAnimation = uni.requireNativePlugin('animation')
class MPAnimation {
constructor(options, _this) {
this.options = options
this.animation = uni.createAnimation(options)
// 在iOS10+QQ小程序平台下传给原生的对象一定是个普通对象而不是Proxy对象否则会报parameter should be Object instead of ProxyObject的错误
this.animation = uni.createAnimation({
...options
})
this.currentStepAnimates = {}
this.next = 0
this.$ = _this

View File

@@ -1,5 +1,10 @@
<template>
<view v-if="isShow" ref="ani" :animation="animationData" :class="customClass" :style="transformStyles" @click="onClick"><slot></slot></view>
<!-- #ifndef APP-NVUE -->
<view v-show="isShow" ref="ani" :animation="animationData" :class="customClass" :style="transformStyles" @click="onClick"><slot></slot></view>
<!-- #endif -->
<!-- #ifdef APP-NVUE -->
<view v-if="isShow" ref="ani" :animation="animationData" :class="customClass" :style="transformStyles" @click="onClick"><slot></slot></view>
<!-- #endif -->
</template>
<script>
@@ -48,7 +53,11 @@ export default {
customClass:{
type: String,
default: ''
}
},
onceRender:{
type:Boolean,
default:false
},
},
data() {
return {

View File

@@ -1,7 +1,7 @@
{
"id": "uni-transition",
"displayName": "uni-transition 过渡动画",
"version": "1.3.1",
"version": "1.3.2",
"description": "元素的简单过渡动画",
"keywords": [
"uni-ui",
@@ -17,11 +17,7 @@
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
@@ -38,7 +34,8 @@
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue"
},
"uni_modules": {
"dependencies": ["uni-scss"],