兼兼街公众号代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

234 lines
5.5 KiB

2 years ago
  1. <template>
  2. <view class="my-pages">
  3. <view class="temps-box">
  4. <view class="head-mode" @click="toLogin">
  5. <u--image shape="circle" :src="userInfo?userInfo.headImage : morenSrc" width="149rpx" height="149rpx" ></u--image>
  6. <view class="head-name">{{userInfo?userInfo.nickName : '未登录'}}</view>
  7. <view> {{userInfo?'余额:'+userInfo.price : ''}}</view>
  8. <view>{{userInfo?'积分:'+userInfo.integerPrice : ''}}</view>
  9. </view>
  10. <view class="btns">
  11. <view class="btns-context" v-for="(item,i) in cellList" :key="i" @click="toUrl(item.pages,item.name)">
  12. <image style="width: 60rpx;height: 60rpx; padding: 40rpx 40rpx;" :src="item.src" mode=""></image>
  13. <view style="padding: 54rpx 0;">{{item.name}}</view>
  14. <view style="margin-left: auto; padding: 55rpx 40rpx;">
  15. <view class="menu-after"></view>
  16. </view>
  17. </view>
  18. </view>
  19. <view class="kefu-box">
  20. <view class="kefu">
  21. <view class="image">
  22. <image class="image-img" src="../../static/kefu.png" @click="previewImg('../../static/kefu.png')" mode=""></image>
  23. </view>
  24. </view>
  25. <view class="kefufont"> @湖南瀚海黎明信息科技有限公司提供技术支持 </view>
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. export default{
  32. data(){
  33. return{
  34. userInfo:null,
  35. role:0,//2销售商
  36. morenSrc:require('@/static/img/logon-icon.png'),
  37. cellList: [
  38. {
  39. name:'邀请二维码',
  40. src:require('@/static/img/info/code.png'),
  41. role:'0',
  42. pages:'/pages/my/my-xiansuo-new'
  43. },
  44. {
  45. name:'我的粉丝',
  46. src:require('@/static/img/info/fans.png'),
  47. role:'0',
  48. pages:'/pages/my/list-fensi'
  49. },
  50. {
  51. name:'我要发布',
  52. src:require('@/static/img/tabbar/fabu-xuan.png'),
  53. role:'0',
  54. pages:'/pages/my/my-fabujianzhi'
  55. },
  56. {
  57. name:'发布信息',
  58. src:require('@/static/img/tabbar/fabu-xuan.png'),
  59. role:'0',
  60. pages:'/pages/my/my-fabujianzhi-list'
  61. },
  62. ]
  63. }
  64. },
  65. onShow() {
  66. this.getmyInfo()
  67. },
  68. // 隐藏微信h5的标题栏
  69. onReady() {
  70. this.$com.displayNav()
  71. },
  72. methods:{
  73. previewImg(imageUrl){
  74. var images = [];
  75. images.push(imageUrl);
  76. console.log(images) // ["http://192.168.100.251:8970/6_1597822634094.png"]
  77. uni.previewImage({ // 预览图片 图片路径必须是一个数组 => ["http://192.168.100.251:8970/6_1597822634094.png"]
  78. current:0,
  79. urls:images,
  80. longPressActions: { //长按保存图片到相册
  81. itemList: ['保存图片'],
  82. success: (data)=> {
  83. console.log(data);
  84. uni.saveImageToPhotosAlbum({ //保存图片到相册
  85. filePath: payUrl,
  86. success: function () {
  87. uni.showToast({icon:'success',title:'保存成功'})
  88. },
  89. fail: (err) => {
  90. uni.showToast({icon:'none',title:'保存失败,请重新尝试'})
  91. }
  92. });
  93. },
  94. fail: (err)=> {
  95. console.log(err.errMsg);
  96. }
  97. }
  98. });
  99. },
  100. getmyInfo(){
  101. this.$api('myInfo')
  102. .then(res=>{
  103. if(res.code == 200){
  104. this.role = res.result.role;
  105. this.userInfo = res.result;
  106. this.$store.commit('set_userInfo',res.result)
  107. }else{
  108. this.userInfo = null
  109. }
  110. })
  111. },
  112. toUrl(url,name){
  113. this.$api('myInfo')
  114. .then(res=>{
  115. if(res.code == 200){
  116. this.role = res.result.role;
  117. this.userInfo = res.result;
  118. this.$store.commit('set_userInfo',res.result)
  119. uni.navigateTo({
  120. url
  121. })
  122. // if(name=='邀请二维码' || name=='我的粉丝' || name=='实名认证' || name=='我要发布'){
  123. // }else{
  124. // this.$Toast('未开放,敬请期待!')
  125. // }
  126. }else{
  127. this.$Toast('请先登录!')
  128. setTimeout(()=>{
  129. uni.navigateTo({
  130. url:'/pages/my/login-kehu'
  131. })
  132. },1000)
  133. return
  134. this.userInfo = null
  135. }
  136. })
  137. },
  138. toLogin(){
  139. if(!this.userInfo){
  140. uni.navigateTo({
  141. url:"/pages/my/login-kehu"
  142. })
  143. }else{
  144. uni.navigateTo({
  145. url:'/pages/my/edit-user'
  146. })
  147. }
  148. }
  149. }
  150. }
  151. </script>
  152. <style lang="scss" scoped>
  153. .my-pages {
  154. background: url("@/static/2.png");
  155. background-size: 100% 100%;
  156. width: 100vw;
  157. height: calc(100vh - 80rpx);
  158. }
  159. .temps-box {
  160. //background-color: #00CCCC;
  161. height: 538rpx;
  162. .head-mode {
  163. display: flex;
  164. justify-items: center;
  165. height:168rpx;
  166. padding: 50rpx 20rpx 20rpx 20rpx;
  167. //background-color: #00CCCC;
  168. .head-name {
  169. padding: 38rpx;
  170. font-size: 40rpx;
  171. font-weight: 600;
  172. font-family: SimSun;
  173. }
  174. }
  175. .btns {
  176. margin-top: 15rpx;
  177. background-color: #FFFFFF;
  178. .btns-context {
  179. height: 120rpx;
  180. display:flex;
  181. border-bottom:1px solid #F7F7F7;
  182. }
  183. }
  184. .kefu-box {
  185. position: absolute;
  186. bottom: 50rpx;
  187. .kefu{
  188. width: 100vw;
  189. display: flex;
  190. text-align: center;
  191. justify-items: center;
  192. .image{
  193. display: flex;
  194. margin: 0 auto;
  195. text-align: center;
  196. justify-items: center;
  197. }
  198. }
  199. .kefufont{
  200. padding: 20rpx 0;
  201. width: 100%;
  202. position: absolute;
  203. font-size: 20rpx;
  204. text-align:center;
  205. color: #5E5E5E;
  206. }
  207. .image-img {
  208. width: 147rpx;
  209. height: 147rpx;
  210. }
  211. }
  212. .menu-after {
  213. width: 15rpx;
  214. height: 15rpx;
  215. border-right: 3rpx solid #808080;
  216. border-bottom: 3rpx solid #808080;
  217. transform:rotate(-45deg);
  218. }
  219. }
  220. </style>