index.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. <template>
  2. <view class="pages_manage flex-1 hb column hidden">
  3. <dataIndex v-if="tabact==0"></dataIndex>
  4. <courseIndex v-if="tabact==1" @child-data-update='onChildDataUpdate' :parent-method="handleParentMethod"></courseIndex>
  5. <memberIndex v-if="tabact==2" @childEvent='chlidpages' style="height: 100%;"></memberIndex>
  6. <UrgeIndex v-if="tabact==3" style="height: 100%;"></UrgeIndex>
  7. <manageIndex v-if="tabact==4" @childsales='chlidSalsepages'></manageIndex>
  8. <view class="footbox" >
  9. <view @click="tabclick(item)" v-for="(item,index) in listtab" class="column align-center flex-1" :key="index">
  10. <image :src="tabact==item.value?item.tabsel:item.tab" class="w50 h50"></image>
  11. <view class="fs24" :class="tabact==item.value?'actcolor':'colortab'">{{item.name}}</view>
  12. </view>
  13. </view>
  14. <view style="flex:0">
  15. <u-popup :show="showShare" :closeOnClickOverlay="true" :round='20' @close="closeShare" >
  16. <view class="sharePop x-ac">
  17. <!--#ifdef MP-WEIXIN-->
  18. <view class="sharePop-item y-f card-share">
  19. <image :src="imgPath+'/app/images/card_icon.png'"
  20. mode="aspectFill" style="width: 80rpx; height: 80rpx;margin-top: 20rpx;" ></image>
  21. <!-- <view style="font-weight: bold;margin-bottom: 4px;" v-if="imgname!='阜新枫汇三'">生成卡片</view>今阜新枫汇三<view style="font-size: 12px;color: #888;" v-if="imgname!='今健阜新枫汇三>指导分享轻松转发</view>
  22. <button open-type="share" class="share" v-if="imgname!='今阜新枫汇三">分享课程</button> -->
  23. <!-- <view @click="copy" v-if="imgname!='乐氏本源'"
  24. class="base-color-6 u-border ptb10 plr30 radius50 mt20">复制页面地址</view> -->
  25. <view style="font-weight: bold;margin-bottom: 4px;" >生成卡片</view>
  26. <view style="font-size: 12px;color: #888;" >指导分享轻松转发</view>
  27. <button open-type="share" class="share" >分享课程</button>
  28. <view @click="copy" v-if="imgname!='阜新枫汇三'"
  29. class="base-color-6 u-border ptb10 plr30 radius50 mt20">复制页面地址</view>
  30. </view>
  31. <!--#endif-->
  32. </view>
  33. </u-popup>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. import dataIndex from './components/dataIndex.vue'
  39. import courseIndex from './components/courseIndex.vue'
  40. import memberIndex from './components/memberIndex.vue'
  41. import UrgeIndex from './components/UrgeIndex.vue'
  42. import manageIndex from './components/manageIndex.vue'
  43. import {copyuniLink,getlinkCode} from "@/api/manageCompany.js"
  44. export default{
  45. components:{
  46. dataIndex,
  47. courseIndex,
  48. memberIndex,
  49. UrgeIndex,
  50. manageIndex
  51. },
  52. data(){
  53. return{
  54. showShare:false,
  55. tabact:1,
  56. childdata:[],
  57. vipPages:'',
  58. salsepages:'',
  59. projectCode:'',
  60. // appid:this.$store.state.appid
  61. listtab:[
  62. {
  63. name:'数据',
  64. value:0,
  65. tab:require("@/static/manageTabIcon/data.png"),
  66. tabsel:require('@/static/manageTabIcon/data_on.png')
  67. },
  68. {
  69. name:'课程库',
  70. value:1,
  71. tab:require('@/static/manageTabIcon/liveclasses.png'),
  72. tabsel:require('@/static/manageTabIcon/liveclasses_on.png')
  73. },
  74. {
  75. name:'会员',
  76. value:2,
  77. tab:require('@/static/manageTabIcon/vip.png'),
  78. tabsel:require('@/static/manageTabIcon/vip_on.png')
  79. },
  80. {
  81. name:'催课',
  82. value:3,
  83. tab:require('@/static/manageTabIcon/training.png'),
  84. tabsel:require('@/static/manageTabIcon/training_on.png')
  85. },
  86. {
  87. name:'管理',
  88. value:4,
  89. tab:require('@/static/manageTabIcon/manage.png'),
  90. tabsel:require('@/static/manageTabIcon/manage_on.png')
  91. }
  92. ],
  93. companyUserInfo:JSON.parse(uni.getStorageSync('companyUserInfo'))
  94. }
  95. },
  96. computed: {
  97. appid() {
  98. return this.$store.state.appid
  99. },
  100. imgPath() {
  101. return this.$store.state.imgpath
  102. },
  103. imgname() {
  104. return this.$store.state.logoname
  105. }
  106. },
  107. onShareAppMessage() {
  108. if(this.tabact==1){
  109. return {
  110. title: this.childdata.title, // 分享卡片标题
  111. path: this.childdata.path + "?course=" + JSON.stringify(this.childdata.params), // 目标页面路径
  112. // 携带参数:将当前页面的数据拼接到路径中
  113. imageUrl: this.childdata.img, // 分享卡片封面图(可选)
  114. success: (res) => {
  115. console.log("分享成功", res);
  116. },
  117. fail: (err) => {
  118. console.log("分享失败", err);
  119. },
  120. }
  121. }
  122. if(this.tabact==2){
  123. return {
  124. title:this.$store.state.logoname+'小程序的'+this.companyUserInfo.nickName + '邀请您成为会员!',
  125. path: this.vipPages,
  126. imageUrl: this.imgPath+'/app/image/logoshare.png',
  127. }
  128. }
  129. if(this.tabact==4){
  130. return {
  131. title:this.$store.state.logoname+'小程序的'+this.companyUserInfo.nickName + '邀请您成为销售!',
  132. path: this.salsepages,
  133. imageUrl: this.imgPath+'/app/image/logoshare.png',
  134. }
  135. }
  136. },
  137. onLoad(option) {
  138. this.tabact=option.act?option.act:1
  139. },
  140. methods:{
  141. copy(){
  142. console.log("hhh")
  143. uni.showLoading({
  144. title: "处理中..."
  145. });
  146. this.getlinkCodes()
  147. },
  148. setlnk(){
  149. const path ='/pages_course/courseCover'
  150. const data={
  151. appid:'wx503cf8ab31f83dd4',
  152. // appid:this.appid,
  153. linkStr:path + "?course=" + JSON.stringify(this.childdata.params)
  154. }
  155. copyuniLink(data).then(res=>{
  156. if(res.code==200){
  157. uni.hideLoading();
  158. setTimeout(() => {
  159. uni.setClipboardData({
  160. data:res.data,
  161. // data:path + "?course=" + JSON.stringify(this.childdata.params),
  162. success: () => {
  163. uni.showToast({
  164. title: '链接已复制',
  165. icon: 'none',
  166. duration: 2000
  167. });
  168. },
  169. fail: () => {
  170. uni.showToast({
  171. title: '复制失败',
  172. icon: 'none'
  173. });
  174. }
  175. });
  176. }, 200)
  177. }else{
  178. uni.hideLoading();
  179. uni.showToast({
  180. title: res.msg,
  181. icon: 'none'
  182. });
  183. }
  184. })
  185. },
  186. getlinkCodes(){
  187. getlinkCode().then(res=>{
  188. if(res.code){
  189. this.childdata.params.projectCode=res.code
  190. this.projectCode=res.data
  191. this.setlnk()
  192. console.log(this.childdata.params)
  193. }
  194. })
  195. },
  196. chlidpages(e){
  197. this.vipPages=e
  198. },
  199. chlidSalsepages(e){
  200. console.log('父组件',e)
  201. this.salsepages=e
  202. },
  203. closeShare() {
  204. this.showShare = false
  205. // console.log('open');
  206. },
  207. handleParentMethod() {
  208. },
  209. onChildDataUpdate(data) {
  210. this.childdata = data
  211. this.showShare = this.childdata.onshow
  212. console.log(this.childdata);
  213. console.log('父组件', this.childdata.path + "?course=" +JSON.stringify(this.childdata.params) )
  214. },
  215. tabclick(item){
  216. this.tabact=item.value
  217. uni.setNavigationBarTitle({
  218. title: item.name
  219. });
  220. }
  221. }
  222. }
  223. </script>
  224. <style lang="scss" scoped>
  225. .colortab{
  226. color: #7e7e7e;
  227. }
  228. .actcolor{
  229. color: #1773ff;
  230. }
  231. .footbox{
  232. position: fixed;
  233. bottom: 0;
  234. width: 100%;
  235. background-color: #fff;
  236. display: flex;
  237. justify-content: space-around;
  238. padding-bottom: 40rpx ;
  239. padding-top: 20rpx;
  240. }
  241. .card-share{
  242. position: relative;
  243. }
  244. .share{
  245. display: inline-block;
  246. position: absolute;
  247. top: 0;
  248. left: 0;
  249. width: 100%;
  250. height: 80%;
  251. opacity: 0;
  252. }
  253. .sharePop {
  254. background-color: #fff;
  255. padding: 30rpx 0;
  256. border-radius: 20px 20px 0 0;
  257. /* #ifdef MP-WEIXIN */
  258. /* #endif */
  259. padding-bottom: 50px;
  260. &-item {
  261. padding: 0 10px;
  262. box-sizing: border-box;
  263. font-family: PingFang SC, PingFang SC;
  264. font-weight: 400;
  265. font-size: 14px;
  266. display: inline-flex !important;
  267. image {
  268. height: 48px;
  269. width: 48px;
  270. margin-bottom: 10px;
  271. }
  272. }
  273. }
  274. </style>