加油站付款小程序,打印小票
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.

75 lines
1.3 KiB

9 months ago
  1. <template>
  2. <view class="content">
  3. <button @click="$refs.configPopup.open()">{{ locale.agreement }}</button>
  4. <button @click="$refs.changeLanguage.open()">切换语言</button>
  5. <button @click="$utils.navigateTo('/map/map')">地图</button>
  6. <button @click="uploadImage">图片上传</button>
  7. <text>{{ image }}</text>
  8. <uv-upload
  9. :fileList="fileList"
  10. :maxCount="5"
  11. multiple
  12. width="150rpx"
  13. height="150rpx"
  14. @delete="deleteImage"
  15. @afterRead="afterRead"
  16. :previewFullImage="true"></uv-upload>
  17. <changeLanguage ref="changeLanguage"/>
  18. <configPopup
  19. keyValue="asd"
  20. ref="configPopup"/>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. data() {
  26. return {
  27. image : '',
  28. fileList: [],
  29. }
  30. },
  31. computed : {
  32. locale(){
  33. return this.$t('pages.index.index')
  34. }
  35. },
  36. methods: {
  37. //上传图片
  38. uploadImage(){
  39. let self = this
  40. this.$Oss.ossUploadImage({
  41. success(url){
  42. self.image = url
  43. }
  44. })
  45. },
  46. deleteImage(e){
  47. this.fileList.splice(e.index, 1)
  48. },
  49. afterRead(e){
  50. let self = this
  51. e.file.forEach(file => {
  52. self.$Oss.ossUpload(file.url).then(url => {
  53. self.fileList.push({
  54. url
  55. })
  56. })
  57. })
  58. },
  59. }
  60. }
  61. </script>
  62. <style scoped lang="scss">
  63. .content{
  64. padding: 20px;
  65. button{
  66. margin-bottom: 10rpx;
  67. }
  68. }
  69. </style>